##Install Packages if Needed
if (!require("ggplot2")) install.packages("ggplot2")
Loading required package: ggplot2
Need help getting started? Try the R Graphics Cookbook: https://r-graphics.org
if (!require("cowplot")) install.packages("cowplot")
Loading required package: cowplot
if (!require("lubridate")) install.packages("lubridate")
Loading required package: lubridate
Attaching package: ‘lubridate’
The following object is masked from ‘package:cowplot’:
stamp
The following objects are masked from ‘package:base’:
date, intersect, setdiff, union
if (!require("corrplot")) install.packages("corrplot")
Loading required package: corrplot
corrplot 0.92 loaded
if (!require("lme4")) install.packages("lme4")
Loading required package: lme4
Loading required package: Matrix
if (!require("vegan")) install.packages("vegan")
Loading required package: vegan
Loading required package: permute
Loading required package: lattice
This is vegan 2.6-4
if (!require("DHARMa")) install.packages("DHARMa")
Loading required package: DHARMa
This is DHARMa 0.4.6. For overview type '?DHARMa'. For recent changes, type news(package = 'DHARMa')
if (!require("effectsize")) install.packages("effectsize")
Loading required package: effectsize
if (!require("emmeans")) install.packages("emmeans")
Loading required package: emmeans
if (!require("lmerTest")) install.packages("lmerTest")
Loading required package: lmerTest
Attaching package: ‘lmerTest’
The following object is masked from ‘package:lme4’:
lmer
The following object is masked from ‘package:stats’:
step
if (!require("tidyr")) install.packages("tidyr")
Loading required package: tidyr
Attaching package: ‘tidyr’
The following objects are masked from ‘package:Matrix’:
expand, pack, unpack
if (!require("dplyr")) install.packages("dplyr")
Loading required package: dplyr
Attaching package: ‘dplyr’
The following objects are masked from ‘package:stats’:
filter, lag
The following objects are masked from ‘package:base’:
intersect, setdiff, setequal, union
if (!require("plotrix")) install.packages("plotrix")
Loading required package: plotrix
Warning: package ‘plotrix’ was built under R version 4.3.2
if (!require("Rmisc")) install.packages("Rmisc")
Loading required package: Rmisc
Loading required package: plyr
------------------------------------------------------------------------------------------
You have loaded plyr after dplyr - this is likely to cause problems.
If you need functions from both plyr and dplyr, please load plyr first, then dplyr:
library(plyr); library(dplyr)
------------------------------------------------------------------------------------------
Attaching package: ‘plyr’
The following objects are masked from ‘package:dplyr’:
arrange, count, desc, failwith, id, mutate, rename, summarise, summarize
##Load Packages
library(ggplot2) #Required for ggplots
library(cowplot) #Required for plotting panel figures
library(lubridate) #Required for date and time formatting
library(corrplot) #Required for correlation plot
library(lme4) #Required for mixed effects modeling
library(vegan) #Required for multivariate analysis PERM
library(DHARMa) #Required to check residuals of mixed effects models
library(effectsize) #Required for eta_squared effect sizes
library(emmeans) #Required for pairwise comparisons
library(lmerTest) #Required for p values with lme4 model summaries
library(tidyr) #Required for pivot_wider function
library(dplyr) #Required for group_by function
library(plotrix) #Required for Standard error function
library(Rmisc) #Required for SummarySE function
#Note: Run "Graphing Parameters" section from 01_ExperimentalSetup.Rmd file
##Growth
Length<-read.csv("Data/Length.csv", header=TRUE)
Dates<-read.csv("Data/BonaireDates.csv", header=TRUE)
##Set date variables
Dates$Date<-as.Date(Dates$Date, format='%m/%d/%Y')
##Set factor variables
Length$Site<-factor(Length$Site, levels=c("KL", "SS"))
Length$Genotype<-factor(Length$Genotype, levels=c("AC8", "AC10", "AC12"))
Length$Orig<-factor(Length$Orig, levels=c("N", "T"))
Length$Origin<-factor(Length$Origin, levels=c("Native", "Transplant"))
##Add a Sample Set Variable
Length$Set<-paste(Length$Site, Length$Genotype, Length$Orig, sep=".")
Length$Set<-factor(Length$Set)
##Add Site.Orig variable
Length$Site.Orig<-paste(Length$Site, Length$Orig, sep=".")
Length$Site.Orig<-factor(Length$Site.Orig, levels=c("KL.N", "KL.T", "SS.N", "SS.T"))
##Bleaching Metrics
#Note: Physiological metrics calculated in 02_PhysiologyMetrics.R file
Thermal<-read.csv("Outputs/ThermData.csv", header=TRUE)
##Set factor variables
Thermal$TimeP<-factor(Thermal$TimeP, levels=c("IN", "TP1", "TP2", "TP3", "TP4"))
Thermal$Site<-factor(Thermal$Site, levels=c("KL", "SS"))
Thermal$Genotype<-factor(Thermal$Genotype, levels=c("AC8", "AC10", "AC12"))
Thermal$Orig<-factor(Thermal$Orig, levels=c("N", "T"))
Thermal$Origin<-factor(Thermal$Origin, levels=c("Native", "Transplant"))
##Subset Dates for TP 1 and TP 2 Growth
Growth.Dates<-subset(Dates, Task=="Growth" & TimeP=="TP1" |
Task=="Growth" & TimeP=="TP2" )
##Convert to Wide format
Growth.Dates<-Growth.Dates %>% pivot_wider(names_from = TimeP, values_from = Date)
##Calculate Number of Days
#TP 1 to TP2
Growth.Dates$TP1.2_days<-time_length(Growth.Dates$TP2-Growth.Dates$TP1, unit="days")
##Merge Length Data with Growth Dates
#Merges by Site column
#Adds TP1.2_days column
Growth<-merge(Length, Growth.Dates[,c(-2)], all.x=TRUE)
##Calculate Linear Extension (cm)
Growth$Ext_cm<-Growth$TL.TP2_cm-Growth$TL.TP1_cm
##Calculate Growth Rate (cm/day)
Growth$TLE_cm.day<-Growth$Ext_cm/Growth$TP1.2_days
##Sample Size per Set
Growth %>%
dplyr::group_by(Set) %>%
dplyr::summarize(SampleSize = length(Set))
##Check for Outliers
ggplot(Growth, aes(x=Set, y=TLE_cm.day)) +
geom_boxplot(alpha=0.5, shape=2, outlier.shape = NA)+
geom_jitter(shape=16, position=position_jitter(0.1))+
theme(axis.text.x = element_text(angle = 90))
##Potential Outliers to Check
Growth$ID[which(Growth$TLE_cm.day>0.4 & Growth$Set=="KL.AC8.N")]
[1] "K8_N_18"
Growth$ID[which(Growth$TLE_cm.day>0.3 & Growth$Set=="KL.AC8.T")]
[1] "K8_T_10"
Growth$ID[which(Growth$TLE_cm.day>0.2 & Growth$Set=="SS.AC10.T")]
[1] "S10_T_18"
Growth$ID[which(Growth$TLE_cm.day>0.5 & Growth$Set=="SS.AC8.N")]
[1] "S8_N_3"
##Temporarily Remove Outliers
Growth.o<-Growth[-c(which(Growth$TLE_cm.day>0.4 & Growth$Set=="KL.AC8.N"),
which(Growth$TLE_cm.day>0.3 & Growth$Set=="KL.AC8.T"),
which(Growth$TLE_cm.day>0.2 & Growth$Set=="SS.AC10.T"),
which(Growth$TLE_cm.day>0.5 & Growth$Set=="SS.AC8.N")),]
##Visual Check
ggplot(Growth.o, aes(x=Set, y=TLE_cm.day)) +
geom_boxplot(alpha=0.5, shape=2, outlier.shape = NA)+
geom_jitter(shape=16, position=position_jitter(0.1))+
theme(axis.text.x = element_text(angle = 90))
Need to add one sample from SS.AC12.T for n=10. Need to re-measure 4 potential outliers.
#Check normality
hist(Growth.o$TLE_cm.day)
shapiro.test(Growth.o$TLE_cm.day)
Shapiro-Wilk normality test
data: Growth.o$TLE_cm.day
W = 0.92765, p-value = 1.124e-05
#Not normal
hist(log(Growth.o$TLE_cm.day+1))
shapiro.test(log(Growth.o$TLE_cm.day+1))
Shapiro-Wilk normality test
data: log(Growth.o$TLE_cm.day + 1)
W = 0.94195, p-value = 8.96e-05
##Still not normal but less skewed
##Model with log +1 transformation
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Growth.lme_TP1.2<-lmer(log(TLE_cm.day+1)~Origin*Site+(1|Genotype), data=Growth.o)
##Check residuals
Growth.lme_res_TP1.2 <- simulateResiduals(fittedModel = Growth.lme_TP1.2, plot = F)
plot(Growth.lme_res_TP1.2)
##Model results
summary(Growth.lme_TP1.2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(TLE_cm.day + 1) ~ Origin * Site + (1 | Genotype)
Data: Growth.o
REML criterion at convergence: -230.8
Scaled residuals:
Min 1Q Median 3Q Max
-1.96412 -0.66635 -0.06801 0.66772 2.35263
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002408 0.04907
Residual 0.006046 0.07775
Number of obs: 114, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.121069 0.031801 2.799396 3.807 0.03592 *
OriginTransplant -0.009813 0.020419 108.006675 -0.481 0.63179
SiteSS 0.054942 0.020604 108.011617 2.667 0.00884 **
OriginTransplant:SiteSS -0.023803 0.029140 108.013428 -0.817 0.41581
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.321
SiteSS -0.318 0.496
OrgnTrn:SSS 0.225 -0.701 -0.707
eta_squared(Growth.lme_TP1.2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.02 | [0.00, 1.00]
Site | 0.07 | [0.01, 1.00]
Origin:Site | 6.14e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Growth.lme_TP1.2_KL<-lmer(log(TLE_cm.day+1)~Origin+(1|Genotype), data=Growth.o[which(Growth.o$Site=="KL"),])
summary(Growth.lme_TP1.2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(TLE_cm.day + 1) ~ Origin + (1 | Genotype)
Data: Growth.o[which(Growth.o$Site == "KL"), ]
REML criterion at convergence: -117.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.7723 -0.6809 -0.1124 0.6260 2.4530
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.001295 0.03598
Residual 0.006039 0.07771
Number of obs: 58, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.120714 0.025297 2.870287 4.772 0.0193 *
OriginTransplant -0.009813 0.020407 54.015809 -0.481 0.6326
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.403
eta_squared(Growth.lme_TP1.2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 4.26e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Growth.lme_TP1.2_SS<-lmer(log(TLE_cm.day+1)~Origin+(1|Genotype), data=Growth.o[which(Growth.o$Site=="SS"),])
summary(Growth.lme_TP1.2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(TLE_cm.day + 1) ~ Origin + (1 | Genotype)
Data: Growth.o[which(Growth.o$Site == "SS"), ]
REML criterion at convergence: -110.5
Scaled residuals:
Min 1Q Median 3Q Max
-2.04429 -0.57222 0.00963 0.70511 2.23913
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.003478 0.05897
Residual 0.006107 0.07815
Number of obs: 56, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.17649 0.03713 2.37305 4.754 0.0294 *
OriginTransplant -0.03373 0.02090 52.03013 -1.613 0.1127
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.282
eta_squared(Growth.lme_TP1.2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.05 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP1.2_Growth.sum<-summarySE(Growth.o, measurevar="TLE_cm.day", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Growth Rate across Treatments
TP1.2_Growth.plot<-ggplot(TP1.2_Growth.sum, aes(x=Site, y=TLE_cm.day, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=TLE_cm.day-se, ymax=TLE_cm.day+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y=expression(paste('Growth Rate (cm day'^-1*")")), colour="Origin")+
ylim(0, 0.3); TP1.2_Growth.plot
##Summary statistics by Genotype and Origin
TP1.2_Growth.sum.SS<-summarySE(subset(Growth.o, Site=="SS"), measurevar="TLE_cm.day", groupvars=c("Genotype", "Origin"), na.rm=TRUE)
TP1.2_Growth.sum.SS
##Calculate Percent Difference between Native and Transplant by Genotype
TP1.2_Growth.SS<-TP1.2_Growth.sum.SS[which(TP1.2_Growth.sum.SS$Origin=="Native"), c(1,4)]
names(TP1.2_Growth.SS)[2]<-paste(names(TP1.2_Growth.SS)[2], "N", sep="_")
TP1.2_Growth.SS$TLE_cm.day_T<-TP1.2_Growth.sum.SS$TLE_cm.day[which(TP1.2_Growth.sum.SS$Origin=="Transplant")]
TP1.2_Growth.SS$Perc.Inc<-((TP1.2_Growth.SS$TLE_cm.day_N-TP1.2_Growth.SS$TLE_cm.day_T)/TP1.2_Growth.SS$TLE_cm.day_T)*100
TP1.2_Growth.SS
##Mean and Standard Error
mean(TP1.2_Growth.SS$Perc.Inc)
[1] 40.13645
std.error(TP1.2_Growth.SS$Perc.Inc)
[1] 27.33582
##Control
Therm_C<-subset(Thermal, Treat=="C")
##Heated
Therm_H<-subset(Thermal, Treat=="H")
Calculating retention as proportion remaining relative to corresponding control levels (0-1) for each site and genotype at each timepoint.
##Calculate averages for Control Treatment for each Site, Genotype, and Timepoint
Therm_C<-na.omit(Therm_C)
names(Therm_C)
[1] "ID" "RandN" "TimeP" "Site" "Genotype" "Treat"
[7] "Treatment" "Orig" "Origin" "Set" "Site.Orig" "SA_cm2"
[13] "Chl_ug.cm2" "Sym10.6_cm2" "Fv_Fm"
Therm_C.a<-aggregate(Therm_C[,c(13:15)], list(Therm_C$Site, Therm_C$Genotype, Therm_C$TimeP, Therm_C$Origin), mean, na.action = na.omit)
names(Therm_C.a)[1:4]<-c("Site", "Genotype", "TimeP", "Origin")
names(Therm_C.a)[5:7]<-paste(names(Therm_C.a)[5:7], "C", sep="_")
##Merge Control Averages with Heated Samples
#Merges by Site, Genotype, and Timepoint
Therm_H<-merge(Therm_H, Therm_C.a, all.x=TRUE )
##Calculate Proportion Retained for each Bleaching Metric relative to Control
Therm_H$Chl.prop<-round((Therm_H$Chl_ug.cm2/Therm_H$Chl_ug.cm2_C), 4)
Therm_H$Sym.prop<-round((Therm_H$Sym10.6_cm2/Therm_H$Sym10.6_cm2_C), 4)
Therm_H$PAM.prop<-round((Therm_H$Fv_Fm/Therm_H$Fv_Fm_C), 4)
##Set values >1 to 1
Therm_H$Chl.prop[which(Therm_H$Chl.prop>1)]<-1.0000
Therm_H$Sym.prop[which(Therm_H$Sym.prop>1)]<-1.0000
Therm_H$PAM.prop[which(Therm_H$PAM.prop>1)]<-1.0000
##Subset Initial Timepoint
Thermal_IN<-subset(Thermal, TimeP=="IN")
Thermal_IN$Site.Treat<-paste(Thermal_IN$Site, Thermal_IN$Treat, sep=".")
Thermal_IN$Site.Treat<-factor(Thermal_IN$Site.Treat, levels=c("KL.C", "KL.H", "SS.C", "SS.H"))
Therm_IN<-subset(Therm_H, TimeP=="IN")
#Check normality
hist(Thermal_IN$Sym10.6_cm2)
shapiro.test(Thermal_IN$Sym10.6_cm2)
Shapiro-Wilk normality test
data: Thermal_IN$Sym10.6_cm2
W = 0.90824, p-value = 0.001334
#Not normal
hist(log(Thermal_IN$Sym10.6_cm2+1))
shapiro.test(log(Thermal_IN$Sym10.6_cm2+1))
Shapiro-Wilk normality test
data: log(Thermal_IN$Sym10.6_cm2 + 1)
W = 0.95667, p-value = 0.07936
#Normal
##Model
#Function of Site and Treatment, with Genotype as a Random effect
Sym.lme_IN<-lmer(log(Sym10.6_cm2+1)~Site*Treatment+(1|Genotype), data=Thermal_IN)
##Check residuals
Sym.lme_res_IN <- simulateResiduals(fittedModel = Sym.lme_IN, plot = F)
plot(Sym.lme_res_IN)
##Model results
summary(Sym.lme_IN)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym10.6_cm2 + 1) ~ Site * Treatment + (1 | Genotype)
Data: Thermal_IN
REML criterion at convergence: -29.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.79325 -0.66013 0.08255 0.57806 2.12486
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0008222 0.02867
Residual 0.0230525 0.15183
Number of obs: 47, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.38823 0.04685 14.06727 8.286 8.77e-07 ***
SiteSS 0.19508 0.06198 41.00308 3.147 0.00307 **
TreatmentHeat -0.20370 0.06340 41.10985 -3.213 0.00256 **
SiteSS:TreatmentHeat -0.01724 0.08867 41.05799 -0.194 0.84677
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) SiteSS TrtmnH
SiteSS -0.661
TreatmentHt -0.647 0.489
StSS:TrtmnH 0.462 -0.699 -0.715
eta_squared(Sym.lme_IN)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
----------------------------------------------
Site | 0.30 | [0.12, 1.00]
Treatment | 0.36 | [0.17, 1.00]
Site:Treatment | 9.20e-04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
emmeans(Sym.lme_IN, pairwise ~ Site | Treatment)
$emmeans
Treatment = Control:
Site emmean SE df lower.CL upper.CL
KL 0.388 0.0469 14.1 0.2878 0.489
SS 0.583 0.0469 14.1 0.4829 0.684
Treatment = Heat:
Site emmean SE df lower.CL upper.CL
KL 0.185 0.0488 15.6 0.0808 0.288
SS 0.362 0.0469 14.1 0.2619 0.463
Degrees-of-freedom method: kenward-roger
Results are given on the log(mu + 1) (not the response) scale.
Confidence level used: 0.95
$contrasts
Treatment = Control:
contrast estimate SE df t.ratio p.value
KL - SS -0.195 0.0620 41.0 -3.147 0.0031
Treatment = Heat:
contrast estimate SE df t.ratio p.value
KL - SS -0.178 0.0635 41.1 -2.801 0.0077
Note: contrasts are still on the log(mu + 1) scale
Degrees-of-freedom method: kenward-roger
emmeans(Sym.lme_IN, pairwise ~ Treatment | Site)
$emmeans
Site = KL:
Treatment emmean SE df lower.CL upper.CL
Control 0.388 0.0469 14.1 0.2878 0.489
Heat 0.185 0.0488 15.6 0.0808 0.288
Site = SS:
Treatment emmean SE df lower.CL upper.CL
Control 0.583 0.0469 14.1 0.4829 0.684
Heat 0.362 0.0469 14.1 0.2619 0.463
Degrees-of-freedom method: kenward-roger
Results are given on the log(mu + 1) (not the response) scale.
Confidence level used: 0.95
$contrasts
Site = KL:
contrast estimate SE df t.ratio p.value
Control - Heat 0.204 0.0635 41.1 3.209 0.0026
Site = SS:
contrast estimate SE df t.ratio p.value
Control - Heat 0.221 0.0620 41.0 3.564 0.0009
Note: contrasts are still on the log(mu + 1) scale
Degrees-of-freedom method: kenward-roger
##Summary statistics by Site
IN_Sym.sum<-summarySE(Thermal_IN, measurevar="Sym10.6_cm2", groupvars=c("Site", "Treatment", "Site.Treat"), na.rm=TRUE)
##Plot Average Symbionts across Treatments
IN_Sym.plot<-ggplot(IN_Sym.sum, aes(x=Site.Treat, y=Sym10.6_cm2, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Sym10.6_cm2-se, ymax=Sym10.6_cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(aes(shape=Treatment), size=point.sz, position=position_dodge(width=0.5))+
scale_shape_manual(values=c(1,16))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Treatment", y=expression(paste('Symbiont Density ('*10^6,'cells cm'^-2*")")), colour="Site")+
ylim(0, 1); IN_Sym.plot
#Check normality
hist(Thermal_IN$Chl_ug.cm2)
shapiro.test(Thermal_IN$Chl_ug.cm2)
Shapiro-Wilk normality test
data: Thermal_IN$Chl_ug.cm2
W = 0.88059, p-value = 0.0002132
#Not normal
hist(log(Thermal_IN$Chl_ug.cm2+1))
shapiro.test(log(Thermal_IN$Chl_ug.cm2+1))
Shapiro-Wilk normality test
data: log(Thermal_IN$Chl_ug.cm2 + 1)
W = 0.92511, p-value = 0.005653
#Still not normal but less skewed
##Model
#Function of Site and Treatment, with Genotype as a Random effect
Chl.lme_IN<-lmer(log(Chl_ug.cm2+1)~Site*Treatment+(1|Genotype), data=Thermal_IN)
##Check residuals
Chl.lme_res_IN <- simulateResiduals(fittedModel = Chl.lme_IN, plot = F)
plot(Chl.lme_res_IN)
##Model results
summary(Chl.lme_IN)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl_ug.cm2 + 1) ~ Site * Treatment + (1 | Genotype)
Data: Thermal_IN
REML criterion at convergence: -69.1
Scaled residuals:
Min 1Q Median 3Q Max
-2.50589 -0.51517 0.07352 0.50169 2.35158
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.006137 0.07834
Residual 0.007930 0.08905
Number of obs: 46, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.45648 0.05202 2.95779 8.774 0.00329 **
SiteSS 0.27810 0.03635 39.99255 7.650 2.38e-09 ***
TreatmentHeat -0.37295 0.03721 40.00578 -10.024 1.80e-12 ***
SiteSS:TreatmentHeat -0.16117 0.05265 40.01278 -3.061 0.00393 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) SiteSS TrtmnH
SiteSS -0.349
TreatmentHt -0.341 0.489
StSS:TrtmnH 0.241 -0.691 -0.707
eta_squared(Chl.lme_IN)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
----------------------------------------------
Site | 0.58 | [0.41, 1.00]
Treatment | 0.88 | [0.82, 1.00]
Site:Treatment | 0.19 | [0.04, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
emmeans(Chl.lme_IN, pairwise ~ Site | Treatment)
$emmeans
Treatment = Control:
Site emmean SE df lower.CL upper.CL
KL 0.4565 0.0520 2.97 0.2899 0.623
SS 0.7346 0.0520 2.97 0.5680 0.901
Treatment = Heat:
Site emmean SE df lower.CL upper.CL
KL 0.0835 0.0526 3.11 -0.0808 0.248
SS 0.2005 0.0526 3.11 0.0361 0.365
Degrees-of-freedom method: kenward-roger
Results are given on the log(mu + 1) (not the response) scale.
Confidence level used: 0.95
$contrasts
Treatment = Control:
contrast estimate SE df t.ratio p.value
KL - SS -0.278 0.0364 40 -7.650 <.0001
Treatment = Heat:
contrast estimate SE df t.ratio p.value
KL - SS -0.117 0.0381 40 -3.070 0.0038
Note: contrasts are still on the log(mu + 1) scale
Degrees-of-freedom method: kenward-roger
emmeans(Chl.lme_IN, pairwise ~ Treatment | Site)
$emmeans
Site = KL:
Treatment emmean SE df lower.CL upper.CL
Control 0.4565 0.0520 2.97 0.2899 0.623
Heat 0.0835 0.0526 3.11 -0.0808 0.248
Site = SS:
Treatment emmean SE df lower.CL upper.CL
Control 0.7346 0.0520 2.97 0.5680 0.901
Heat 0.2005 0.0526 3.11 0.0361 0.365
Degrees-of-freedom method: kenward-roger
Results are given on the log(mu + 1) (not the response) scale.
Confidence level used: 0.95
$contrasts
Site = KL:
contrast estimate SE df t.ratio p.value
Control - Heat 0.373 0.0372 40 10.022 <.0001
Site = SS:
contrast estimate SE df t.ratio p.value
Control - Heat 0.534 0.0372 40 14.353 <.0001
Note: contrasts are still on the log(mu + 1) scale
Degrees-of-freedom method: kenward-roger
##Summary statistics by Site
IN_Chl.sum<-summarySE(Thermal_IN, measurevar="Chl_ug.cm2", groupvars=c("Site", "Treatment", "Site.Treat"), na.rm=TRUE)
##Plot Average Chlorophyll across Treatments
IN_Chl.plot<-ggplot(IN_Chl.sum, aes(x=Site.Treat, y=Chl_ug.cm2, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Chl_ug.cm2-se, ymax=Chl_ug.cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(aes(shape=Treatment), size=point.sz, position=position_dodge(width=0.5))+
scale_shape_manual(values=c(1,16))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Treatment", y=expression(paste('Total Chlorophyll (\u03BCg cm'^-2*")")), colour="Site")+
ylim(0, 1.25); IN_Chl.plot
#Check normality
hist(Thermal_IN$Fv_Fm)
shapiro.test(Thermal_IN$Fv_Fm)
Shapiro-Wilk normality test
data: Thermal_IN$Fv_Fm
W = 0.87006, p-value = 9.097e-05
#Not normal
hist(log(Thermal_IN$Fv_Fm+1))
shapiro.test(log(Thermal_IN$Fv_Fm+1))
Shapiro-Wilk normality test
data: log(Thermal_IN$Fv_Fm + 1)
W = 0.85365, p-value = 3.226e-05
#Still not normal but less skewed
##Model
#Function of Site and Treatment, with Genotype as a Random effect
PAM.lme_IN<-lmer(log(Fv_Fm+1)~Site*Treatment+(1|Genotype), data=Thermal_IN)
boundary (singular) fit: see help('isSingular')
##Check residuals
PAM.lme_res_IN <- simulateResiduals(fittedModel = PAM.lme_IN, plot = F)
plot(PAM.lme_res_IN)
##Model results
summary(PAM.lme_IN)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Fv_Fm + 1) ~ Site * Treatment + (1 | Genotype)
Data: Thermal_IN
REML criterion at convergence: -202.7
Scaled residuals:
Min 1Q Median 3Q Max
-3.7092 -0.4159 0.1391 0.6366 1.5720
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0000000 0.00000
Residual 0.0004174 0.02043
Number of obs: 47, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.480202 0.005897 43.000000 81.425 < 2e-16 ***
SiteSS 0.013981 0.008340 43.000000 1.676 0.101
TreatmentHeat -0.044190 0.008528 43.000000 -5.182 5.57e-06 ***
SiteSS:TreatmentHeat 0.022162 0.011928 43.000000 1.858 0.070 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) SiteSS TrtmnH
SiteSS -0.707
TreatmentHt -0.692 0.489
StSS:TrtmnH 0.494 -0.699 -0.715
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(PAM.lme_IN)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
----------------------------------------------
Site | 0.29 | [0.12, 1.00]
Treatment | 0.42 | [0.23, 1.00]
Site:Treatment | 0.07 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
emmeans(PAM.lme_IN, pairwise ~ Site | Treatment)
$emmeans
Treatment = Control:
Site emmean SE df lower.CL upper.CL
KL 0.480 0.00590 21.6 0.468 0.492
SS 0.494 0.00590 21.6 0.482 0.506
Treatment = Heat:
Site emmean SE df lower.CL upper.CL
KL 0.436 0.00618 23.5 0.423 0.449
SS 0.472 0.00590 21.6 0.460 0.484
Degrees-of-freedom method: kenward-roger
Results are given on the log(mu + 1) (not the response) scale.
Confidence level used: 0.95
$contrasts
Treatment = Control:
contrast estimate SE df t.ratio p.value
KL - SS -0.0140 0.00834 41.0 -1.676 0.1013
Treatment = Heat:
contrast estimate SE df t.ratio p.value
KL - SS -0.0361 0.00855 41.2 -4.229 0.0001
Note: contrasts are still on the log(mu + 1) scale
Degrees-of-freedom method: kenward-roger
emmeans(PAM.lme_IN, pairwise ~ Treatment | Site)
$emmeans
Site = KL:
Treatment emmean SE df lower.CL upper.CL
Control 0.480 0.00590 21.6 0.468 0.492
Heat 0.436 0.00618 23.5 0.423 0.449
Site = SS:
Treatment emmean SE df lower.CL upper.CL
Control 0.494 0.00590 21.6 0.482 0.506
Heat 0.472 0.00590 21.6 0.460 0.484
Degrees-of-freedom method: kenward-roger
Results are given on the log(mu + 1) (not the response) scale.
Confidence level used: 0.95
$contrasts
Site = KL:
contrast estimate SE df t.ratio p.value
Control - Heat 0.0442 0.00855 41.2 5.171 <.0001
Site = SS:
contrast estimate SE df t.ratio p.value
Control - Heat 0.0220 0.00834 41.0 2.641 0.0116
Note: contrasts are still on the log(mu + 1) scale
Degrees-of-freedom method: kenward-roger
##Summary statistics by Site
IN_PAM.sum<-summarySE(Thermal_IN, measurevar="Fv_Fm", groupvars=c("Site", "Treatment", "Site.Treat"), na.rm=TRUE)
##Plot Average FvFm across Treatments
IN_PAM.plot<-ggplot(IN_PAM.sum, aes(x=Site.Treat, y=Fv_Fm, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Fv_Fm-se, ymax=Fv_Fm+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(aes(shape=Treatment), size=point.sz, position=position_dodge(width=0.5))+
scale_shape_manual(values=c(1,16))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Treatment", y="Photochemical Efficiency (Fv/Fm)", colour="Site")+
ylim(0.5, 0.655); IN_PAM.plot
#Check normality
hist(Therm_IN$Sym.prop)
shapiro.test(Therm_IN$Sym.prop)
Shapiro-Wilk normality test
data: Therm_IN$Sym.prop
W = 0.93042, p-value = 0.1117
#Normal
##Model
#Function of Site, with Genotype as a Random effect
Tol_Sym.lme_IN<-lmer(Sym.prop~Site+(1|Genotype), data=Therm_IN)
##Check residuals
Tol_Sym.lme_res_IN <- simulateResiduals(fittedModel = Tol_Sym.lme_IN, plot = F)
plot(Tol_Sym.lme_res_IN)
##Model results
summary(Tol_Sym.lme_IN)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Sym.prop ~ Site + (1 | Genotype)
Data: Therm_IN
REML criterion at convergence: -2.8
Scaled residuals:
Min 1Q Median 3Q Max
-1.6802 -0.6578 -0.1521 0.6805 1.9852
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.07818 0.2796
Residual 0.03039 0.1743
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.46139 0.16983 2.21175 2.717 0.1014
SiteSS 0.14316 0.07291 19.00328 1.964 0.0644 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
SiteSS -0.225
eta_squared(Tol_Sym.lme_IN)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Site | 0.17 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site
IN_TolSym.sum<-summarySE(Therm_IN, measurevar="Sym.prop", groupvars=c("Site"), na.rm=TRUE)
##Plot Average Symbiont Retention across Treatments
IN_TolSym.plot<-ggplot(IN_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site", y="Symbiont Retention", colour="Site")+
ylim(0, 1)+
annotate("text", x=1.5, y=0.75, label="-", size=sig.sz, fontface="bold"); IN_TolSym.plot
#Check normality
hist(Therm_IN$Chl.prop)
shapiro.test(Therm_IN$Chl.prop)
Shapiro-Wilk normality test
data: Therm_IN$Chl.prop
W = 0.98432, p-value = 0.9694
#Normal
##Model
#Function of Site, with Genotype as a Random effect
Tol_Chl.lme_IN<-lmer(Chl.prop~Site+(1|Genotype), data=Therm_IN)
##Check residuals
Tol_Chl.lme_res_IN <- simulateResiduals(fittedModel = Tol_Chl.lme_IN, plot = F)
plot(Tol_Chl.lme_res_IN)
##Model results
summary(Tol_Chl.lme_IN)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl.prop ~ Site + (1 | Genotype)
Data: Therm_IN
REML criterion at convergence: -47.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.3909 -0.5550 -0.1823 0.5284 1.9947
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.004576 0.06765
Residual 0.003436 0.05861
Number of obs: 22, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.16552 0.04290 2.40867 3.858 0.045 *
SiteSS 0.04306 0.02514 18.06310 1.713 0.104
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
SiteSS -0.293
eta_squared(Tol_Chl.lme_IN)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Site | 0.14 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
IN_TolChl.sum<-summarySE(Therm_IN, measurevar="Chl.prop", groupvars=c("Site"), na.rm=TRUE)
##Plot Average Chlorophyll Retention across Treatments
IN_TolChl.plot<-ggplot(IN_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site", y="Chlorophyll Retention", colour="Site")+
ylim(0, 0.35); IN_TolChl.plot
#Check normality
hist(Therm_IN$PAM.prop)
shapiro.test(Therm_IN$PAM.prop)
Shapiro-Wilk normality test
data: Therm_IN$PAM.prop
W = 0.8289, p-value = 0.001154
#Not normal
hist(log(Therm_IN$PAM.prop+1))
shapiro.test(log(Therm_IN$PAM.prop+1))
Shapiro-Wilk normality test
data: log(Therm_IN$PAM.prop + 1)
W = 0.81061, p-value = 0.0005693
##Still not normal
##Model
#Function of Site, with Genotype as a Random effect
Tol_PAM.lme_IN<-lmer(PAM.prop~Site+(1|Genotype), data=Therm_IN)
##Check residuals
Tol_PAM.lme_res_IN <- simulateResiduals(fittedModel = Tol_PAM.lme_IN, plot = F)
plot(Tol_PAM.lme_res_IN)
##Model results
summary(Tol_PAM.lme_IN)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Site + (1 | Genotype)
Data: Therm_IN
REML criterion at convergence: -50.5
Scaled residuals:
Min 1Q Median 3Q Max
-2.7860 -0.2498 0.1225 0.5362 1.4591
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002221 0.04713
Residual 0.003538 0.05948
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.89138 0.03262 2.77551 27.325 0.000185 ***
SiteSS 0.05230 0.02487 19.00103 2.103 0.049053 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
SiteSS -0.399
eta_squared(Tol_PAM.lme_IN)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Site | 0.19 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
IN_TolPAM.sum<-summarySE(Therm_IN, measurevar="PAM.prop", groupvars=c("Site"), na.rm=TRUE)
##Plot Average FvFm Retention across Treatments
IN_TolPAM.plot<-ggplot(IN_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site", y="Photochemical Efficiency Retention", colour="Site")+
ylim(0.6, 1)+
annotate("text", x=1.5, y=1, label="*", size=sig.sz, fontface="bold"); IN_TolPAM.plot
##Subset Timepoint 1
Therm_TP1<-subset(Therm_H, TimeP=="TP1")
#Check normality
hist(Therm_TP1$Sym.prop)
shapiro.test(Therm_TP1$Sym.prop)
Shapiro-Wilk normality test
data: Therm_TP1$Sym.prop
W = 0.91699, p-value = 0.002332
#Not normal
hist(log(Therm_TP1$Sym.prop+1))
shapiro.test(log(Therm_TP1$Sym.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP1$Sym.prop + 1)
W = 0.92258, p-value = 0.003671
##Still not normal but less skewed
##Model with log +1 transformation
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Sym.lme_TP1<-lmer(log(Sym.prop+1)~Origin*Site+(1|Genotype), data=Therm_TP1)
##Check residuals
Tol_Sym.lme_res_TP1 <- simulateResiduals(fittedModel = Tol_Sym.lme_TP1, plot = F)
plot(Tol_Sym.lme_res_TP1)
##Model results
summary(Tol_Sym.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin * Site + (1 | Genotype)
Data: Therm_TP1
REML criterion at convergence: -33.1
Scaled residuals:
Min 1Q Median 3Q Max
-3.1715 -0.5714 0.0059 0.7146 1.9799
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.03376 0.1837
Residual 0.01886 0.1373
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.27621 0.11324 2.42412 2.439 0.1128
OriginTransplant 0.11668 0.05606 42.00000 2.081 0.0435 *
SiteSS 0.06309 0.05606 42.00000 1.125 0.2668
OriginTransplant:SiteSS -0.13250 0.07928 42.00000 -1.671 0.1021
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.248
SiteSS -0.248 0.500
OrgnTrn:SSS 0.175 -0.707 -0.707
eta_squared(Tol_Sym.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.04 | [0.00, 1.00]
Site | 1.51e-04 | [0.00, 1.00]
Origin:Site | 0.06 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Sym.lme_TP1_KL<-lmer(log(Sym.prop+1)~Origin+(1|Genotype), data=Therm_TP1[which(Therm_TP1$Site=="KL"),])
summary(Tol_Sym.lme_TP1_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP1[which(Therm_TP1$Site == "KL"), ]
REML criterion at convergence: -21.7
Scaled residuals:
Min 1Q Median 3Q Max
-2.22211 -0.64466 0.06469 0.75749 1.28798
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.04259 0.2064
Residual 0.01291 0.1136
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.27621 0.12358 2.14836 2.235 0.1461
OriginTransplant 0.11668 0.04638 20.00000 2.516 0.0205 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.188
eta_squared(Tol_Sym.lme_TP1_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.24 | [0.02, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Sym.lme_TP1_SS<-lmer(log(Sym.prop+1)~Origin+(1|Genotype), data=Therm_TP1[which(Therm_TP1$Site=="SS"),])
summary(Tol_Sym.lme_TP1_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP1[which(Therm_TP1$Site == "SS"), ]
REML criterion at convergence: -8.8
Scaled residuals:
Min 1Q Median 3Q Max
-2.4670 -0.5662 0.1529 0.6190 1.4817
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.02355 0.1535
Residual 0.02580 0.1606
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.33930 0.10000 2.50724 3.393 0.0557 .
OriginTransplant -0.01583 0.06558 20.00000 -0.241 0.8118
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.328
eta_squared(Tol_Sym.lme_TP1_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 2.90e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP1_TolSym.sum<-summarySE(Therm_TP1, measurevar="Sym.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Symbiont Retention across Treatments
TP1_TolSym.plot<-ggplot(TP1_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Symbiont Retention", colour="Origin")+
ylim(0, 1)+
annotate("text", x=1, y=0.75, label="*", size=sig.sz, fontface="bold"); TP1_TolSym.plot
#Check normality
hist(Therm_TP1$Chl.prop)
shapiro.test(Therm_TP1$Chl.prop)
Shapiro-Wilk normality test
data: Therm_TP1$Chl.prop
W = 0.94139, p-value = 0.01836
#Not normal
hist(log(Therm_TP1$Chl.prop+1))
shapiro.test(log(Therm_TP1$Chl.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP1$Chl.prop + 1)
W = 0.94765, p-value = 0.03227
##Still not normal but less skewed
##Model with log +1 transformation
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Chl.lme_TP1<-lmer(log(Chl.prop+1)~Origin*Site+(1|Genotype), data=Therm_TP1)
##Check residuals
Tol_Chl.lme_res_TP1 <- simulateResiduals(fittedModel = Tol_Chl.lme_TP1, plot = F)
plot(Tol_Chl.lme_res_TP1)
##Model results
summary(Tol_Chl.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin * Site + (1 | Genotype)
Data: Therm_TP1
REML criterion at convergence: -112.2
Scaled residuals:
Min 1Q Median 3Q Max
-2.1439 -0.5458 -0.0382 0.6267 1.8760
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.008382 0.09155
Residual 0.003065 0.05537
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.13931 0.05522 2.27664 2.523 0.113
OriginTransplant 0.01521 0.02260 42.00000 0.673 0.505
SiteSS 0.02628 0.02260 42.00000 1.163 0.251
OriginTransplant:SiteSS -0.02689 0.03197 42.00000 -0.841 0.405
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.205
SiteSS -0.205 0.500
OrgnTrn:SSS 0.145 -0.707 -0.707
eta_squared(Tol_Chl.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 2.90e-04 | [0.00, 1.00]
Site | 0.02 | [0.00, 1.00]
Origin:Site | 0.02 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Chl.lme_TP1_KL<-lmer(log(Chl.prop+1)~Origin+(1|Genotype), data=Therm_TP1[which(Therm_TP1$Site=="KL"),])
summary(Tol_Chl.lme_TP1_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP1[which(Therm_TP1$Site == "KL"), ]
REML criterion at convergence: -55.4
Scaled residuals:
Min 1Q Median 3Q Max
-2.04878 -0.58286 0.01887 0.57011 1.44796
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.007318 0.08555
Residual 0.002846 0.05334
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.13931 0.05173 2.18924 2.693 0.104
OriginTransplant 0.01521 0.02178 20.00000 0.698 0.493
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.210
eta_squared(Tol_Chl.lme_TP1_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.02 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Chl.lme_TP1_SS<-lmer(log(Chl.prop+1)~Origin+(1|Genotype), data=Therm_TP1[which(Therm_TP1$Site=="SS"),])
summary(Tol_Chl.lme_TP1_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP1[which(Therm_TP1$Site == "SS"), ]
REML criterion at convergence: -50.8
Scaled residuals:
Min 1Q Median 3Q Max
-1.43149 -0.56754 -0.06902 0.58853 1.85344
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.009135 0.09558
Residual 0.003511 0.05926
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.16560 0.05777 2.18712 2.866 0.0931 .
OriginTransplant -0.01168 0.02419 20.00000 -0.483 0.6344
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.209
eta_squared(Tol_Chl.lme_TP1_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.01 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP1_TolChl.sum<-summarySE(Therm_TP1, measurevar="Chl.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Chlorophyll Retention across Treatments
TP1_TolChl.plot<-ggplot(TP1_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Chlorophyll Retention", colour="Origin")+
ylim(0, 0.35); TP1_TolChl.plot
#Check normality
hist(Therm_TP1$PAM.prop)
shapiro.test(Therm_TP1$PAM.prop)
Shapiro-Wilk normality test
data: Therm_TP1$PAM.prop
W = 0.84073, p-value = 1.245e-05
#Not normal
hist(log(Therm_TP1$PAM.prop+1))
shapiro.test(log(Therm_TP1$PAM.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP1$PAM.prop + 1)
W = 0.82049, p-value = 3.908e-06
##Still not normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_PAM.lme_TP1<-lmer(PAM.prop~Origin*Site+(1|Genotype), data=Therm_TP1)
##Check residuals
Tol_PAM.lme_res_TP1 <- simulateResiduals(fittedModel = Tol_PAM.lme_TP1, plot = F)
plot(Tol_PAM.lme_res_TP1)
##Model results
summary(Tol_PAM.lme_TP1)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin * Site + (1 | Genotype)
Data: Therm_TP1
REML criterion at convergence: -84.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.3058 -0.3498 0.1733 0.6717 1.7818
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002735 0.05230
Residual 0.006214 0.07883
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.86181 0.03781 3.74555 22.794 3.72e-05 ***
OriginTransplant 0.06813 0.03218 42.00000 2.117 0.0402 *
SiteSS -0.01277 0.03218 42.00000 -0.397 0.6936
OriginTransplant:SiteSS -0.07942 0.04551 42.00000 -1.745 0.0883 .
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.426
SiteSS -0.426 0.500
OrgnTrn:SSS 0.301 -0.707 -0.707
eta_squared(Tol_PAM.lme_TP1)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.04 | [0.00, 1.00]
Site | 0.11 | [0.01, 1.00]
Origin:Site | 0.07 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_PAM.lme_TP1_KL<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP1[which(Therm_TP1$Site=="KL"),])
summary(Tol_PAM.lme_TP1_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP1[which(Therm_TP1$Site == "KL"), ]
REML criterion at convergence: -57.2
Scaled residuals:
Min 1Q Median 3Q Max
-2.21445 -0.36299 0.09321 0.61667 1.51097
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0009092 0.03015
Residual 0.0031116 0.05578
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.86181 0.02371 3.34791 36.341 1.82e-05 ***
OriginTransplant 0.06813 0.02277 20.00000 2.992 0.00721 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.480
eta_squared(Tol_PAM.lme_TP1_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.31 | [0.06, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_PAM.lme_TP1_SS<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP1[which(Therm_TP1$Site=="SS"),])
summary(Tol_PAM.lme_TP1_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP1[which(Therm_TP1$Site == "SS"), ]
REML criterion at convergence: -33.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.69510 -0.36658 0.09367 0.51233 1.74473
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.005306 0.07284
Residual 0.008775 0.09367
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.84904 0.05000 2.73586 16.981 0.000746 ***
OriginTransplant -0.01128 0.03824 20.00000 -0.295 0.770994
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.382
eta_squared(Tol_PAM.lme_TP1_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 4.33e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP1_TolPAM.sum<-summarySE(Therm_TP1, measurevar="PAM.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average FvFm Retention across Treatments
TP1_TolPAM.plot<-ggplot(TP1_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Photochemical Efficiency Retention", colour="Origin")+
ylim(0.6, 1)+
annotate("text", x=1, y=1, label="**", size=sig.sz, fontface="bold"); TP1_TolPAM.plot
##Subset Timepoint 2
Therm_TP2<-subset(Therm_H, TimeP=="TP2")
#Check normality
hist(Therm_TP2$Sym.prop)
shapiro.test(Therm_TP2$Sym.prop)
Shapiro-Wilk normality test
data: Therm_TP2$Sym.prop
W = 0.89527, p-value = 0.0004439
#Not normal
hist(log(Therm_TP2$Sym.prop+1))
shapiro.test(log(Therm_TP2$Sym.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP2$Sym.prop + 1)
W = 0.88978, p-value = 0.000299
##Still not normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Sym.lme_TP2<-lmer(Sym.prop~Origin*Site+(1|Genotype), data=Therm_TP2)
##Check residuals
Tol_Sym.lme_res_TP2 <- simulateResiduals(fittedModel = Tol_Sym.lme_TP2, plot = F)
plot(Tol_Sym.lme_res_TP2)
##Model results
summary(Tol_Sym.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Sym.prop ~ Origin * Site + (1 | Genotype)
Data: Therm_TP2
REML criterion at convergence: -3.4
Scaled residuals:
Min 1Q Median 3Q Max
-2.20381 -0.54227 0.01202 0.47665 2.09092
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.04681 0.2164
Residual 0.03767 0.1941
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.805833 0.136905 2.613359 5.886 0.0142 *
OriginTransplant -0.107900 0.079237 42.000000 -1.362 0.1805
SiteSS -0.178425 0.079237 42.000000 -2.252 0.0296 *
OriginTransplant:SiteSS 0.005183 0.112058 42.000000 0.046 0.9633
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.289
SiteSS -0.289 0.500
OrgnTrn:SSS 0.205 -0.707 -0.707
eta_squared(Tol_Sym.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.08 | [0.00, 1.00]
Site | 0.19 | [0.04, 1.00]
Origin:Site | 5.09e-05 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Sym.lme_TP2_KL<-lmer(Sym.prop~Origin+(1|Genotype), data=Therm_TP2[which(Therm_TP2$Site=="KL"),])
summary(Tol_Sym.lme_TP2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Sym.prop ~ Origin + (1 | Genotype)
Data: Therm_TP2[which(Therm_TP2$Site == "KL"), ]
REML criterion at convergence: -1.7
Scaled residuals:
Min 1Q Median 3Q Max
-2.0500 -0.8276 0.2039 0.4804 2.0614
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.04096 0.2024
Residual 0.03487 0.1867
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.80583 0.12868 2.40096 6.262 0.0154 *
OriginTransplant -0.10790 0.07623 20.00000 -1.415 0.1723
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.296
eta_squared(Tol_Sym.lme_TP2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.09 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Sym.lme_TP2_SS<-lmer(Sym.prop~Origin+(1|Genotype), data=Therm_TP2[which(Therm_TP2$Site=="SS"),])
summary(Tol_Sym.lme_TP2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Sym.prop ~ Origin + (1 | Genotype)
Data: Therm_TP2[which(Therm_TP2$Site == "SS"), ]
REML criterion at convergence: 3.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.98373 -0.46709 -0.03333 0.50742 1.82777
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.04792 0.2189
Residual 0.04392 0.2096
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.62741 0.14011 2.42980 4.478 0.032 *
OriginTransplant -0.10272 0.08556 20.00000 -1.201 0.244
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.305
eta_squared(Tol_Sym.lme_TP2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.07 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP2_TolSym.sum<-summarySE(Therm_TP2, measurevar="Sym.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP2_TolSym.plot<-ggplot(TP2_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Symbiont Retention", colour="Origin")+
ylim(0, 1); TP2_TolSym.plot
#Check normality
hist(Therm_TP2$Chl.prop)
shapiro.test(Therm_TP2$Chl.prop)
Shapiro-Wilk normality test
data: Therm_TP2$Chl.prop
W = 0.97677, p-value = 0.4523
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Chl.lme_TP2<-lmer(Chl.prop~Origin*Site+(1|Genotype), data=Therm_TP2)
##Check residuals
Tol_Chl.lme_res_TP2 <- simulateResiduals(fittedModel = Tol_Chl.lme_TP2, plot = F)
plot(Tol_Chl.lme_res_TP2)
##Model results
summary(Tol_Chl.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl.prop ~ Origin * Site + (1 | Genotype)
Data: Therm_TP2
REML criterion at convergence: -81
Scaled residuals:
Min 1Q Median 3Q Max
-2.0024 -0.7622 -0.1174 0.6824 2.9666
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.006146 0.07840
Residual 0.006538 0.08086
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.31077 0.05093 2.81331 6.102 0.0106 *
OriginTransplant -0.03844 0.03301 42.00000 -1.165 0.2508
SiteSS -0.06514 0.03301 42.00000 -1.973 0.0550 .
OriginTransplant:SiteSS 0.06166 0.04668 42.00000 1.321 0.1937
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.324
SiteSS -0.324 0.500
OrgnTrn:SSS 0.229 -0.707 -0.707
eta_squared(Tol_Chl.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 2.53e-03 | [0.00, 1.00]
Site | 0.05 | [0.00, 1.00]
Origin:Site | 0.04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Chl.lme_TP2_KL<-lmer(Chl.prop~Origin+(1|Genotype), data=Therm_TP2[which(Therm_TP2$Site=="KL"),])
summary(Tol_Chl.lme_TP2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl.prop ~ Origin + (1 | Genotype)
Data: Therm_TP2[which(Therm_TP2$Site == "KL"), ]
REML criterion at convergence: -39.9
Scaled residuals:
Min 1Q Median 3Q Max
-0.9725 -0.7459 -0.3411 0.6270 2.6035
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.006040 0.07772
Residual 0.006269 0.07918
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.31077 0.05036 2.48246 6.171 0.0146 *
OriginTransplant -0.03844 0.03232 20.00001 -1.189 0.2483
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.321
eta_squared(Tol_Chl.lme_TP2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.07 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Chl.lme_TP2_SS<-lmer(Chl.prop~Origin+(1|Genotype), data=Therm_TP2[which(Therm_TP2$Site=="SS"),])
summary(Tol_Chl.lme_TP2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: Chl.prop ~ Origin + (1 | Genotype)
Data: Therm_TP2[which(Therm_TP2$Site == "SS"), ]
REML criterion at convergence: -46
Scaled residuals:
Min 1Q Median 3Q Max
-2.2119 -0.6418 0.2701 0.7660 1.5135
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.009505 0.09749
Residual 0.004441 0.06664
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.24563 0.05948 2.22611 4.129 0.0448 *
OriginTransplant 0.02322 0.02720 20.00000 0.853 0.4035
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.229
eta_squared(Tol_Chl.lme_TP2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP2_TolChl.sum<-summarySE(Therm_TP2, measurevar="Chl.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP2_TolChl.plot<-ggplot(TP2_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Chlorophyll Retention", colour="Origin")+
ylim(0, 0.35); TP2_TolChl.plot
#Check normality
hist(Therm_TP2$PAM.prop)
shapiro.test(Therm_TP2$PAM.prop)
Shapiro-Wilk normality test
data: Therm_TP2$PAM.prop
W = 0.73527, p-value = 5.896e-08
#Not normal
hist(log(Therm_TP2$PAM.prop+1))
shapiro.test(log(Therm_TP2$PAM.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP2$PAM.prop + 1)
W = 0.70205, p-value = 1.443e-08
##Still not normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_PAM.lme_TP2<-lmer(PAM.prop~Origin*Site+(1|Genotype), data=Therm_TP2)
##Check residuals
Tol_PAM.lme_res_TP2 <- simulateResiduals(fittedModel = Tol_PAM.lme_TP2, plot = F)
plot(Tol_PAM.lme_res_TP2)
##Model results
summary(Tol_PAM.lme_TP2)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin * Site + (1 | Genotype)
Data: Therm_TP2
REML criterion at convergence: -102.1
Scaled residuals:
Min 1Q Median 3Q Max
-3.8326 -0.3753 -0.0042 0.5350 1.7496
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.001675 0.04093
Residual 0.004192 0.06475
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.85622 0.03013 3.92146 28.419 1.09e-05 ***
OriginTransplant 0.07526 0.02643 42.00000 2.847 0.00680 **
SiteSS 0.06487 0.02643 42.00000 2.454 0.01834 *
OriginTransplant:SiteSS -0.10206 0.03738 42.00000 -2.730 0.00921 **
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.439
SiteSS -0.439 0.500
OrgnTrn:SSS 0.310 -0.707 -0.707
eta_squared(Tol_PAM.lme_TP2)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.04 | [0.00, 1.00]
Site | 0.01 | [0.00, 1.00]
Origin:Site | 0.15 | [0.02, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_PAM.lme_TP2_KL<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP2[which(Therm_TP2$Site=="KL"),])
summary(Tol_PAM.lme_TP2_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP2[which(Therm_TP2$Site == "KL"), ]
REML criterion at convergence: -40.2
Scaled residuals:
Min 1Q Median 3Q Max
-2.9208 -0.4020 0.2520 0.5255 1.0060
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.003195 0.05653
Residual 0.006508 0.08067
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.85622 0.04009 2.88245 21.356 0.00029 ***
OriginTransplant 0.07526 0.03293 19.99994 2.285 0.03336 *
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.411
eta_squared(Tol_PAM.lme_TP2_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.21 | [0.01, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_PAM.lme_TP2_SS<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP2[which(Therm_TP2$Site=="SS"),])
summary(Tol_PAM.lme_TP2_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP2[which(Therm_TP2$Site == "SS"), ]
REML criterion at convergence: -71.4
Scaled residuals:
Min 1Q Median 3Q Max
-2.04910 -0.74292 -0.04708 0.53594 2.26126
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0004937 0.02222
Residual 0.0016296 0.04037
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.92109 0.01733 3.31062 53.146 5.72e-06 ***
OriginTransplant -0.02680 0.01648 20.00000 -1.626 0.12
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.475
eta_squared(Tol_PAM.lme_TP2_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.12 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP2_TolPAM.sum<-summarySE(Therm_TP2, measurevar="PAM.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP2_TolPAM.plot<-ggplot(TP2_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Photochemical Efficiency Retention", colour="Origin")+
ylim(0.6, 1)+
annotate("text", x=1, y=1, label="*", size=sig.sz, fontface="bold"); TP2_TolPAM.plot
##Subset Timepoint 3
Therm_TP3<-subset(Therm_H, TimeP=="TP3")
#Check normality
hist(Therm_TP3$Sym.prop)
shapiro.test(Therm_TP3$Sym.prop)
Shapiro-Wilk normality test
data: Therm_TP3$Sym.prop
W = 0.78653, p-value = 6.531e-07
#Not normal
hist(log(Therm_TP3$Sym.prop+1))
shapiro.test(log(Therm_TP3$Sym.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP3$Sym.prop + 1)
W = 0.78571, p-value = 6.267e-07
##Still not normal but less skewed
##Model with log +1 transformation
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Sym.lme_TP3<-lmer(log(Sym.prop+1)~Origin*Site+(1|Genotype), data=Therm_TP3)
##Check residuals
Tol_Sym.lme_res_TP3 <- simulateResiduals(fittedModel = Tol_Sym.lme_TP3, plot = F)
plot(Tol_Sym.lme_res_TP3)
##Model results
summary(Tol_Sym.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin * Site + (1 | Genotype)
Data: Therm_TP3
REML criterion at convergence: -108.7
Scaled residuals:
Min 1Q Median 3Q Max
-2.1559 -0.5389 0.3778 0.5963 1.6051
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 8.41e-05 0.00917
Residual 3.90e-03 0.06245
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.59780 0.01879 16.87446 31.815 <2e-16 ***
OriginTransplant 0.03978 0.02550 42.00000 1.560 0.1262
SiteSS 0.05892 0.02550 42.00000 2.311 0.0258 *
OriginTransplant:SiteSS -0.03130 0.03606 42.00000 -0.868 0.3903
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.678
SiteSS -0.678 0.500
OrgnTrn:SSS 0.480 -0.707 -0.707
eta_squared(Tol_Sym.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.04 | [0.00, 1.00]
Site | 0.12 | [0.01, 1.00]
Origin:Site | 0.02 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Sym.lme_TP3_KL<-lmer(log(Sym.prop+1)~Origin+(1|Genotype), data=Therm_TP3[which(Therm_TP3$Site=="KL"),])
summary(Tol_Sym.lme_TP3_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP3[which(Therm_TP3$Site == "KL"), ]
REML criterion at convergence: -48.9
Scaled residuals:
Min 1Q Median 3Q Max
-1.66523 -0.53461 0.01898 0.71797 1.50619
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0003833 0.01958
Residual 0.0048325 0.06952
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.59780 0.02303 5.00842 25.955 1.56e-06 ***
OriginTransplant 0.03978 0.02838 20.00000 1.402 0.176
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.616
eta_squared(Tol_Sym.lme_TP3_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.09 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Sym.lme_TP3_SS<-lmer(log(Sym.prop+1)~Origin+(1|Genotype), data=Therm_TP3[which(Therm_TP3$Site=="SS"),])
boundary (singular) fit: see help('isSingular')
summary(Tol_Sym.lme_TP3_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP3[which(Therm_TP3$Site == "SS"), ]
REML criterion at convergence: -61.8
Scaled residuals:
Min 1Q Median 3Q Max
-2.6314 -0.4640 0.5270 0.5670 0.6869
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.000000 0.00000
Residual 0.002812 0.05302
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.656722 0.015307 22.000000 42.904 <2e-16 ***
OriginTransplant 0.008483 0.021647 22.000000 0.392 0.699
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_Sym.lme_TP3_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 6.93e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP3_TolSym.sum<-summarySE(Therm_TP3, measurevar="Sym.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP3_TolSym.plot<-ggplot(TP3_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Symbiont Retention", colour="Origin")+
ylim(0, 1); TP3_TolSym.plot
#Check normality
hist(Therm_TP3$Chl.prop)
shapiro.test(Therm_TP3$Chl.prop)
Shapiro-Wilk normality test
data: Therm_TP3$Chl.prop
W = 0.89534, p-value = 0.0004461
#Not normal
hist(log(Therm_TP3$Chl.prop+1))
shapiro.test(log(Therm_TP3$Chl.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP3$Chl.prop + 1)
W = 0.9211, p-value = 0.003251
##Still not normal but less skewed
##Model with log +1 transformation
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Chl.lme_TP3<-lmer(log(Chl.prop+1)~Origin*Site+(1|Genotype), data=Therm_TP3)
boundary (singular) fit: see help('isSingular')
##Check residuals
Tol_Chl.lme_res_TP3 <- simulateResiduals(fittedModel = Tol_Chl.lme_TP3, plot = F)
plot(Tol_Chl.lme_res_TP3)
##Model results
summary(Tol_Chl.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin * Site + (1 | Genotype)
Data: Therm_TP3
REML criterion at convergence: -47.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.7095 -0.6080 -0.1405 0.4999 1.7650
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.00000 0.0000
Residual 0.01594 0.1262
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.43851 0.03644 44.00000 12.032 1.65e-15 ***
OriginTransplant 0.03181 0.05154 44.00000 0.617 0.540
SiteSS 0.03852 0.05154 44.00000 0.747 0.459
OriginTransplant:SiteSS -0.02511 0.07289 44.00000 -0.344 0.732
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.707
SiteSS -0.707 0.500
OrgnTrn:SSS 0.500 -0.707 -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_Chl.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 6.31e-03 | [0.00, 1.00]
Site | 0.01 | [0.00, 1.00]
Origin:Site | 2.69e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Chl.lme_TP3_KL<-lmer(log(Chl.prop+1)~Origin+(1|Genotype), data=Therm_TP3[which(Therm_TP3$Site=="KL"),])
summary(Tol_Chl.lme_TP3_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP3[which(Therm_TP3$Site == "KL"), ]
REML criterion at convergence: -35
Scaled residuals:
Min 1Q Median 3Q Max
-2.1966 -0.5212 -0.1283 0.4729 1.9007
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002703 0.05199
Residual 0.008473 0.09205
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.43851 0.04009 3.25876 10.938 0.00112 **
OriginTransplant 0.03181 0.03758 20.00000 0.847 0.40725
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.469
eta_squared(Tol_Chl.lme_TP3_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Chl.lme_TP3_SS<-lmer(log(Chl.prop+1)~Origin+(1|Genotype), data=Therm_TP3[which(Therm_TP3$Site=="SS"),])
boundary (singular) fit: see help('isSingular')
summary(Tol_Chl.lme_TP3_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP3[which(Therm_TP3$Site == "SS"), ]
REML criterion at convergence: -17.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.4740 -0.7462 -0.2782 0.6974 1.4761
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 3.210e-22 1.792e-11
Residual 2.144e-02 1.464e-01
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.477025 0.042265 22.000000 11.286 1.28e-10 ***
OriginTransplant 0.006709 0.059772 22.000000 0.112 0.912
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_Chl.lme_TP3_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 5.72e-04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP3_TolChl.sum<-summarySE(Therm_TP3, measurevar="Chl.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP3_TolChl.plot<-ggplot(TP3_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Chlorophyll Retention", colour="Origin")+
ylim(0, 1); TP3_TolChl.plot
#Check normality
hist(Therm_TP3$PAM.prop)
shapiro.test(Therm_TP3$PAM.prop)
Shapiro-Wilk normality test
data: Therm_TP3$PAM.prop
W = 0.96358, p-value = 0.1408
#Normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_PAM.lme_TP3<-lmer(PAM.prop~Origin*Site+(1|Genotype), data=Therm_TP3)
##Check residuals
Tol_PAM.lme_res_TP3 <- simulateResiduals(fittedModel = Tol_PAM.lme_TP3, plot = F)
plot(Tol_PAM.lme_res_TP3)
##Model results
summary(Tol_PAM.lme_TP3)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin * Site + (1 | Genotype)
Data: Therm_TP3
REML criterion at convergence: -172.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.29399 -0.71463 0.01706 0.83761 1.77082
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 3.177e-05 0.005637
Residual 9.061e-04 0.030101
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.954325 0.009279 14.520200 102.850 <2e-16 ***
OriginTransplant 0.009025 0.012289 42.000000 0.734 0.467
SiteSS 0.003975 0.012289 42.000000 0.323 0.748
OriginTransplant:SiteSS -0.019133 0.017379 42.000000 -1.101 0.277
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.662
SiteSS -0.662 0.500
OrgnTrn:SSS 0.468 -0.707 -0.707
eta_squared(Tol_PAM.lme_TP3)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 9.25e-05 | [0.00, 1.00]
Site | 9.76e-03 | [0.00, 1.00]
Origin:Site | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_PAM.lme_TP3_KL<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP3[which(Therm_TP3$Site=="KL"),])
summary(Tol_PAM.lme_TP3_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP3[which(Therm_TP3$Site == "KL"), ]
REML criterion at convergence: -87.6
Scaled residuals:
Min 1Q Median 3Q Max
-2.4364 -0.5727 0.1072 0.8113 1.2811
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 3.996e-05 0.006322
Residual 8.452e-04 0.029072
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.954325 0.009152 5.656770 104.28 1.65e-10 ***
OriginTransplant 0.009025 0.011869 20.001145 0.76 0.456
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.648
eta_squared(Tol_PAM.lme_TP3_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_PAM.lme_TP3_SS<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP3[which(Therm_TP3$Site=="SS"),])
boundary (singular) fit: see help('isSingular')
summary(Tol_PAM.lme_TP3_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP3[which(Therm_TP3$Site == "SS"), ]
REML criterion at convergence: -84.9
Scaled residuals:
Min 1Q Median 3Q Max
-1.6542 -0.7178 -0.1194 0.6304 1.6515
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.0000000 0.00000
Residual 0.0009841 0.03137
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.958300 0.009056 22.000000 105.820 <2e-16 ***
OriginTransplant -0.010108 0.012807 22.000000 -0.789 0.438
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_PAM.lme_TP3_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP3_TolPAM.sum<-summarySE(Therm_TP3, measurevar="PAM.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP3_TolPAM.plot<-ggplot(TP3_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Photochemical Efficiency Retention", colour="Origin")+
ylim(0.7, 1); TP3_TolPAM.plot
##Subset Timepoint 4
Therm_TP4<-subset(Therm_H, TimeP=="TP4")
#Check normality
hist(Therm_TP4$Sym.prop)
shapiro.test(Therm_TP4$Sym.prop)
Shapiro-Wilk normality test
data: Therm_TP4$Sym.prop
W = 0.93453, p-value = 0.01005
#Not normal
hist(log(Therm_TP4$Sym.prop+1))
shapiro.test(log(Therm_TP4$Sym.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP4$Sym.prop + 1)
W = 0.95458, p-value = 0.061
#Normal
##Model with log +1 transformation
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Sym.lme_TP4<-lmer(log(Sym.prop+1)~Origin*Site+(1|Genotype), data=Therm_TP4)
##Check residuals
Tol_Sym.lme_res_TP4 <- simulateResiduals(fittedModel = Tol_Sym.lme_TP4, plot = F)
plot(Tol_Sym.lme_res_TP4)
##Model results
summary(Tol_Sym.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin * Site + (1 | Genotype)
Data: Therm_TP4
REML criterion at convergence: -44.7
Scaled residuals:
Min 1Q Median 3Q Max
-1.5412 -0.7855 -0.1534 0.5518 2.2412
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.001295 0.03598
Residual 0.016289 0.12763
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.24607 0.04230 9.94436 5.818 0.000173 ***
OriginTransplant 0.04098 0.05210 42.00002 0.787 0.435975
SiteSS -0.03092 0.05210 42.00002 -0.593 0.556032
OriginTransplant:SiteSS -0.03256 0.07369 42.00002 -0.442 0.660816
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.616
SiteSS -0.616 0.500
OrgnTrn:SSS 0.436 -0.707 -0.707
eta_squared(Tol_Sym.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 0.01 | [0.00, 1.00]
Site | 0.04 | [0.00, 1.00]
Origin:Site | 4.63e-03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Sym.lme_TP4_KL<-lmer(log(Sym.prop+1)~Origin+(1|Genotype), data=Therm_TP4[which(Therm_TP4$Site=="KL"),])
summary(Tol_Sym.lme_TP4_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP4[which(Therm_TP4$Site == "KL"), ]
REML criterion at convergence: -26.2
Scaled residuals:
Min 1Q Median 3Q Max
-1.3745 -0.8456 0.0271 0.5432 2.0020
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.002906 0.05391
Residual 0.012909 0.11362
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.24607 0.04522 3.63655 5.442 0.00725 **
OriginTransplant 0.04098 0.04638 20.00000 0.884 0.38746
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.513
eta_squared(Tol_Sym.lme_TP4_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Sym.lme_TP4_SS<-lmer(log(Sym.prop+1)~Origin+(1|Genotype), data=Therm_TP4[which(Therm_TP4$Site=="SS"),])
boundary (singular) fit: see help('isSingular')
summary(Tol_Sym.lme_TP4_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Sym.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP4[which(Therm_TP4$Site == "SS"), ]
REML criterion at convergence: -19.3
Scaled residuals:
Min 1Q Median 3Q Max
-1.19030 -0.85642 -0.01412 0.53810 2.27217
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.00000 0.0000
Residual 0.01944 0.1394
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.215142 0.040247 22.000000 5.346 2.29e-05 ***
OriginTransplant 0.008418 0.056918 22.000000 0.148 0.884
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_Sym.lme_TP4_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 9.93e-04 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP4_TolSym.sum<-summarySE(Therm_TP4, measurevar="Sym.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP4_TolSym.plot<-ggplot(TP4_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Symbiont Retention", colour="Origin")+
ylim(0, 1); TP4_TolSym.plot
#Check normality
hist(Therm_TP4$Chl.prop)
shapiro.test(Therm_TP4$Chl.prop)
Shapiro-Wilk normality test
data: Therm_TP4$Chl.prop
W = 0.94204, p-value = 0.02131
#Not normal
hist(log(Therm_TP4$Chl.prop+1))
shapiro.test(log(Therm_TP4$Chl.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP4$Chl.prop + 1)
W = 0.9512, p-value = 0.04824
##Nearly normal
##Model with log +1 transformation
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_Chl.lme_TP4<-lmer(log(Chl.prop+1)~Origin*Site+(1|Genotype), data=Therm_TP4)
boundary (singular) fit: see help('isSingular')
##Check residuals
Tol_Chl.lme_res_TP4 <- simulateResiduals(fittedModel = Tol_Chl.lme_TP4, plot = F)
plot(Tol_Chl.lme_res_TP4)
##Model results
summary(Tol_Chl.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin * Site + (1 | Genotype)
Data: Therm_TP4
REML criterion at convergence: -139.8
Scaled residuals:
Min 1Q Median 3Q Max
-1.6397 -0.7647 -0.1492 0.5006 2.4251
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.000000 0.00000
Residual 0.001803 0.04246
Number of obs: 47, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.09448 0.01226 43.00000 7.707 1.24e-09 ***
OriginTransplant -0.01266 0.01734 43.00000 -0.730 0.469
SiteSS -0.02659 0.01773 43.00000 -1.500 0.141
OriginTransplant:SiteSS 0.02939 0.02479 43.00000 1.185 0.242
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.707
SiteSS -0.692 0.489
OrgnTrn:SSS 0.494 -0.699 -0.715
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_Chl.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 6.26e-04 | [0.00, 1.00]
Site | 0.02 | [0.00, 1.00]
Origin:Site | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_Chl.lme_TP4_KL<-lmer(log(Chl.prop+1)~Origin+(1|Genotype), data=Therm_TP4[which(Therm_TP4$Site=="KL"),])
boundary (singular) fit: see help('isSingular')
summary(Tol_Chl.lme_TP4_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP4[which(Therm_TP4$Site == "KL"), ]
REML criterion at convergence: -76.7
Scaled residuals:
Min 1Q Median 3Q Max
-1.5133 -0.5558 -0.1258 0.5428 2.7208
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.000000 0.00000
Residual 0.001433 0.03785
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.09448 0.01093 22.00000 8.647 1.59e-08 ***
OriginTransplant -0.01266 0.01545 22.00000 -0.819 0.421
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.707
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_Chl.lme_TP4_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_Chl.lme_TP4_SS<-lmer(log(Chl.prop+1)~Origin+(1|Genotype), data=Therm_TP4[which(Therm_TP4$Site=="SS"),])
boundary (singular) fit: see help('isSingular')
summary(Tol_Chl.lme_TP4_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: log(Chl.prop + 1) ~ Origin + (1 | Genotype)
Data: Therm_TP4[which(Therm_TP4$Site == "SS"), ]
REML criterion at convergence: -64.1
Scaled residuals:
Min 1Q Median 3Q Max
-1.4873 -0.7211 -0.1933 0.5918 2.1830
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.000000 0.00000
Residual 0.002192 0.04681
Number of obs: 23, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.06788 0.01412 21.00000 4.809 9.41e-05 ***
OriginTransplant 0.01673 0.01954 21.00000 0.856 0.402
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.722
optimizer (nloptwrap) convergence code: 0 (OK)
boundary (singular) fit: see help('isSingular')
eta_squared(Tol_Chl.lme_TP4_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP4_TolChl.sum<-summarySE(Therm_TP4, measurevar="Chl.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP4_TolChl.plot<-ggplot(TP4_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Chlorophyll Retention", colour="Origin")+
ylim(0, 0.35); TP4_TolChl.plot
#Check normality
hist(Therm_TP4$PAM.prop)
shapiro.test(Therm_TP4$PAM.prop)
Shapiro-Wilk normality test
data: Therm_TP4$PAM.prop
W = 0.86379, p-value = 5.159e-05
#Not normal
hist(log(Therm_TP4$PAM.prop+1))
shapiro.test(log(Therm_TP4$PAM.prop+1))
Shapiro-Wilk normality test
data: log(Therm_TP4$PAM.prop + 1)
W = 0.84113, p-value = 1.275e-05
##Still not normal
##Model
#Function of Site and Origin, with Genotype as a Random effect
#Interaction between Site and Origin
Tol_PAM.lme_TP4<-lmer(PAM.prop~Origin*Site+(1|Genotype), data=Therm_TP4)
##Check residuals
Tol_PAM.lme_res_TP4 <- simulateResiduals(fittedModel = Tol_PAM.lme_TP4, plot = F)
plot(Tol_PAM.lme_res_TP4)
##Model results
summary(Tol_PAM.lme_TP4)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin * Site + (1 | Genotype)
Data: Therm_TP4
REML criterion at convergence: -60.9
Scaled residuals:
Min 1Q Median 3Q Max
-2.1005 -0.4066 -0.0093 0.5802 2.4408
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.01070 0.1035
Residual 0.01028 0.1014
Number of obs: 48, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.74804 0.06651 2.73320 11.247 0.00228 **
OriginTransplant 0.03239 0.04138 42.00000 0.783 0.43818
SiteSS 0.02783 0.04138 42.00000 0.672 0.50502
OriginTransplant:SiteSS -0.05803 0.05852 42.00000 -0.991 0.32713
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr) OrgnTr SiteSS
OrgnTrnspln -0.311
SiteSS -0.311 0.500
OrgnTrn:SSS 0.220 -0.707 -0.707
eta_squared(Tol_PAM.lme_TP4)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-------------------------------------------
Origin | 3.17e-04 | [0.00, 1.00]
Site | 3.92e-05 | [0.00, 1.00]
Origin:Site | 0.02 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
Effect size of Origin for each Site
##KL
Tol_PAM.lme_TP4_KL<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP4[which(Therm_TP4$Site=="KL"),])
summary(Tol_PAM.lme_TP4_KL)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP4[which(Therm_TP4$Site == "KL"), ]
REML criterion at convergence: -30.9
Scaled residuals:
Min 1Q Median 3Q Max
-1.84954 -0.38862 -0.07926 0.54042 2.60201
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.011716 0.10824
Residual 0.009227 0.09606
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.74804 0.06837 2.37263 10.941 0.00438 **
OriginTransplant 0.03239 0.03922 20.00001 0.826 0.41856
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.287
eta_squared(Tol_PAM.lme_TP4_KL)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.03 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##SS
Tol_PAM.lme_TP4_SS<-lmer(PAM.prop~Origin+(1|Genotype), data=Therm_TP4[which(Therm_TP4$Site=="SS"),])
summary(Tol_PAM.lme_TP4_SS)
Linear mixed model fit by REML. t-tests use Satterthwaite's method ['lmerModLmerTest']
Formula: PAM.prop ~ Origin + (1 | Genotype)
Data: Therm_TP4[which(Therm_TP4$Site == "SS"), ]
REML criterion at convergence: -25.7
Scaled residuals:
Min 1Q Median 3Q Max
-2.08840 -0.38585 0.06028 0.59276 2.02689
Random effects:
Groups Name Variance Std.Dev.
Genotype (Intercept) 0.008458 0.09197
Residual 0.012219 0.11054
Number of obs: 24, groups: Genotype, 3
Fixed effects:
Estimate Std. Error df t value Pr(>|t|)
(Intercept) 0.77587 0.06195 2.65242 12.524 0.00196 **
OriginTransplant -0.02563 0.04513 20.00000 -0.568 0.57634
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Correlation of Fixed Effects:
(Intr)
OrgnTrnspln -0.364
eta_squared(Tol_PAM.lme_TP4_SS)
# Effect Size for ANOVA (Type III)
Parameter | Eta2 (partial) | 95% CI
-----------------------------------------
Origin | 0.02 | [0.00, 1.00]
- One-sided CIs: upper bound fixed at [1.00].
##Summary statistics by Site and Origin
TP4_TolPAM.sum<-summarySE(Therm_TP4, measurevar="PAM.prop", groupvars=c("Site", "Origin", "Site.Orig"), na.rm=TRUE)
##Plot Average Retention across Treatments
TP4_TolPAM.plot<-ggplot(TP4_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="Photochemical Efficiency Retention", colour="Origin")+
ylim(0.6, 1); TP4_TolPAM.plot
##Dataframe of effect size results
Tol.ES<-data.frame(TimeP=c(rep("TP1",6), rep("TP2",6), rep("TP3",6), rep("TP4",6)),
Site=c(rep(c("KL", "SS"),12)),
Metric=c(rep(c("Sym.prop", "Sym.prop", "Chl.prop", "Chl.prop", "PAM.prop", "PAM.prop"),4)),
EtaSq=c(eta_squared(Tol_Sym.lme_TP1_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP1_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP1_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP1_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP1_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP1_SS)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP2_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP2_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP2_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP2_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP2_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP2_SS)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP3_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP3_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP3_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP3_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP3_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP3_SS)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP4_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP4_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP4_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP4_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP4_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP4_SS)$Eta2_partial),
Pvalue=c(summary(Tol_Sym.lme_TP1_KL)$coefficients[10],
summary(Tol_Sym.lme_TP1_SS)$coefficients[10],
summary(Tol_Chl.lme_TP1_KL)$coefficients[10],
summary(Tol_Chl.lme_TP1_SS)$coefficients[10],
summary(Tol_PAM.lme_TP1_KL)$coefficients[10],
summary(Tol_PAM.lme_TP1_SS)$coefficients[10],
summary(Tol_Sym.lme_TP2_KL)$coefficients[10],
summary(Tol_Sym.lme_TP2_SS)$coefficients[10],
summary(Tol_Chl.lme_TP2_KL)$coefficients[10],
summary(Tol_Chl.lme_TP2_SS)$coefficients[10],
summary(Tol_PAM.lme_TP2_KL)$coefficients[10],
summary(Tol_PAM.lme_TP2_SS)$coefficients[10],
summary(Tol_Sym.lme_TP3_KL)$coefficients[10],
summary(Tol_Sym.lme_TP3_SS)$coefficients[10],
summary(Tol_Chl.lme_TP3_KL)$coefficients[10],
summary(Tol_Chl.lme_TP3_SS)$coefficients[10],
summary(Tol_PAM.lme_TP3_KL)$coefficients[10],
summary(Tol_PAM.lme_TP3_SS)$coefficients[10],
summary(Tol_Sym.lme_TP4_KL)$coefficients[10],
summary(Tol_Sym.lme_TP4_SS)$coefficients[10],
summary(Tol_Chl.lme_TP4_KL)$coefficients[10],
summary(Tol_Chl.lme_TP4_SS)$coefficients[10],
summary(Tol_PAM.lme_TP4_KL)$coefficients[10],
summary(Tol_PAM.lme_TP4_SS)$coefficients[10]))
Tol.ES$Sig<-ifelse(Tol.ES$Pvalue<0.001, "***", ifelse(Tol.ES$Pvalue<0.01, "**", ifelse(Tol.ES$Pvalue<0.05, "*", ifelse(Tol.ES$Pvalue<0.1, "-", NA))))
Tol_Sym.ES.plot<-ggplot(Tol.ES[which(Tol.ES$Metric=="Sym.prop"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Symbiont Retention")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5), axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Time Point", y=expression(paste("Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.4)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold"); Tol_Sym.ES.plot
Tol_Chl.ES.plot<-ggplot(Tol.ES[which(Tol.ES$Metric=="Chl.prop"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Chlorophyll Retention")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5), axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Time Point", y=expression(paste("Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.4)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold"); Tol_Chl.ES.plot
Tol_PAM.ES.plot<-ggplot(Tol.ES[which(Tol.ES$Metric=="PAM.prop"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Photochemical Efficiency Retention")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5), axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Time Point", y=expression(paste("Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.4)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold"); Tol_PAM.ES.plot
Calculating the average of Growth (TP1 to TP2) and Thermal Tolerance (Retention of Symbionts, Chlorophyll, and Photochemical Efficiency at TP1) for each Set (Site, Genotype, Origin)
##Average
names(Growth.o)
[1] "Site" "ID" "Orig" "Origin" "Genotype" "TL.TP1_cm"
[7] "TL.TP2_cm" "Set" "Site.Orig" "TP1" "TP2" "TP1.2_days"
[13] "Ext_cm" "TLE_cm.day"
Growth_Set<-aggregate(Growth.o$TLE_cm.day, list(Growth.o$Site, Growth.o$Genotype, Growth.o$Orig), mean)
names(Growth_Set)<-c("Site", "Genotype", "Orig", "TLE_cm.day")
##Add Standard Error
Growth_Set$TLE_se<-aggregate(Growth.o$TLE_cm.day, list(Growth.o$Site, Growth.o$Genotype, Growth.o$Orig), std.error)[,4]
##Average
names(Therm_TP1)
[1] "TimeP" "Site" "Genotype" "Origin" "ID"
[6] "RandN" "Treat" "Treatment" "Orig" "Set"
[11] "Site.Orig" "SA_cm2" "Chl_ug.cm2" "Sym10.6_cm2" "Fv_Fm"
[16] "Chl_ug.cm2_C" "Sym10.6_cm2_C" "Fv_Fm_C" "Chl.prop" "Sym.prop"
[21] "PAM.prop"
Therm_Set<-aggregate(Therm_TP1[,c(19:21)], list(Therm_TP1$Site, Therm_TP1$Genotype, Therm_TP1$Orig), mean)
names(Therm_Set)<-c("Site", "Genotype", "Orig", "Chl.prop", "Sym.prop", "PAM.prop")
##Add Standard Error
Therm_Set$Chl_se<-aggregate(Therm_TP1$Chl.prop, list(Therm_TP1$Site, Therm_TP1$Genotype, Therm_TP1$Orig), std.error)[,4]
Therm_Set$Sym_se<-aggregate(Therm_TP1$Sym.prop, list(Therm_TP1$Site, Therm_TP1$Genotype, Therm_TP1$Orig), std.error)[,4]
Therm_Set$PAM_se<-aggregate(Therm_TP1$PAM.prop, list(Therm_TP1$Site, Therm_TP1$Genotype, Therm_TP1$Orig), std.error)[,4]
Perf_Set<-merge(Growth_Set, Therm_Set, all=TRUE)
Perf_Set$Set<-paste(Perf_Set$Site, Perf_Set$Genotype, Perf_Set$Orig, sep=".")
##Set factor variables
Perf_Set$Site<-factor(Perf_Set$Site, levels=c("KL", "SS"))
Perf_Set$Genotype<-factor(Perf_Set$Genotype, levels=c("AC8", "AC10", "AC12"))
Perf_Set$Orig<-factor(Perf_Set$Orig, levels=c("N", "T"))
##Add a Sample Set Variable
Perf_Set$Set<-paste(Perf_Set$Site, Perf_Set$Genotype, Perf_Set$Orig, sep=".")
Perf_Set$Set<-factor(Perf_Set$Set)
##Add Site.Orig variable
Perf_Set$Site.Orig<-paste(Perf_Set$Site, Perf_Set$Orig, sep=".")
Perf_Set$Site.Orig<-factor(Perf_Set$Site.Orig, levels=c("KL.N", "KL.T", "SS.N", "SS.T"))
cor.test(Perf_Set$TLE_cm.day, Perf_Set$Sym.prop, method="spearman")
Spearman's rank correlation rho
data: Perf_Set$TLE_cm.day and Perf_Set$Sym.prop
S = 470, p-value = 0.02795
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
-0.6433566
TLE_Sym.plot<-ggplot(Perf_Set, aes(x=TLE_cm.day, y=Sym.prop)) +
geom_smooth(method="lm", color="#AA185AFF", fill="#F8D7BFFF", se=TRUE)+
geom_point(aes(colour=Site.Orig),size=point.sz)+
scale_colour_manual(values=Orig.colors.o)+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x=expression(paste('Growth Rate (cm day'^-1*")")),
y="Symbiont Retention",
colour="Site Origin")+
annotate("text", x = 0.07, y = 0, label=expression(bolditalic(paste(r[S], " = -0.643, p = 0.028"))), size=sig.sz, hjust = 0); TLE_Sym.plot
cor.test(Perf_Set$TLE_cm.day, Perf_Set$Chl.prop, method="spearman")
Spearman's rank correlation rho
data: Perf_Set$TLE_cm.day and Perf_Set$Chl.prop
S = 466, p-value = 0.03239
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
-0.6293706
TLE_Chl.plot<-ggplot(Perf_Set, aes(x=TLE_cm.day, y=Chl.prop)) +
geom_smooth(method="lm", color="#AA185AFF", fill="#F8D7BFFF", se=TRUE)+
geom_point(aes(colour=Site.Orig),size=point.sz)+
scale_colour_manual(values=Orig.colors.o)+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x=expression(paste('Growth Rate (cm day'^-1*")")),
y="Chlorophyll Retention",
colour="Site Origin")+
annotate("text", x = 0.07, y = 0, label=expression(bolditalic(paste(r[S], " = -0.629, p = 0.032"))), size=sig.sz, hjust = 0); TLE_Chl.plot
cor.test(Perf_Set$TLE_cm.day, Perf_Set$PAM.prop, method="spearman")
Spearman's rank correlation rho
data: Perf_Set$TLE_cm.day and Perf_Set$PAM.prop
S = 474, p-value = 0.02398
alternative hypothesis: true rho is not equal to 0
sample estimates:
rho
-0.6573427
TLE_PAM.plot<-ggplot(Perf_Set, aes(x=TLE_cm.day, y=PAM.prop)) +
geom_smooth(method="lm", color="#AA185AFF", fill="#F8D7BFFF", se=TRUE)+
geom_point(aes(colour=Site.Orig),size=point.sz)+
scale_colour_manual(values=Orig.colors.o)+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x=expression(paste('Growth Rate (cm day'^-1*")")),
y="Photo. Effic. Retention",
colour="Site Origin")+
annotate("text", x = 0.07, y = 0.74, label=expression(bolditalic(paste(r[S], " = -0.657, p = 0.024"))), size=sig.sz, hjust = 0); TLE_PAM.plot
##Growth
TP1.2_Growth.plot.cut<-ggplot(TP1.2_Growth.sum, aes(x=Site, y=TLE_cm.day, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=TLE_cm.day-se, ymax=TLE_cm.day+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"), legend.position=c(0.2, 0.8))+
labs(x="Site and Origin", y=expression(paste('Growth Rate (cm day'^-1*")")), colour="Origin")+
ylim(0, 0.3)
##FvFm Retention
Tol_PAM.ES.plot.cut<-ggplot(Tol.ES[which(Tol.ES$Metric=="PAM.prop"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Photochemical Efficiency")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5), axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"), legend.position=c(0.8, 0.8))+
labs(x="Time Point", y=expression(paste("Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.35)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold")
##Symbiont Retention
Tol_Sym.ES.plot.cut<-ggplot(Tol.ES[which(Tol.ES$Metric=="Sym.prop"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Symbionts")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5), axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.position="none")+
labs(x="Time Point", y=expression(paste("Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.35)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold")
##Chlorophyll Retention
Tol_Chl.ES.plot.cut<-ggplot(Tol.ES[which(Tol.ES$Metric=="Chl.prop"),], aes(x=TimeP, y=EtaSq, fill=Site))+
geom_bar(stat="identity", position=position_dodge())+
scale_fill_manual(values=Site.colors.o)+
theme_classic()+
ggtitle("Chlorophyll")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, hjust=0.5), axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.position="none")+
labs(x="Time Point", y=expression(paste("Effect Size (p", eta^2, ")")), colour="Site")+
ylim(0, 0.35)+
geom_text(aes(label=Sig), vjust=-0.02, color="black", position=position_dodge(0.9), size=levels.sz, fontface="bold")
##Create Panel
Performance_fig<-plot_grid(TP1.2_Growth.plot.cut, Tol_PAM.ES.plot.cut,
Tol_Sym.ES.plot.cut, Tol_Chl.ES.plot.cut,
rel_widths=c(1, 1, 1, 1),
rel_heights = c(1, 1, 1, 1),
nrow=2, ncol=2, byrow=T, labels = c("A", "B", "C", "D"))
##Save Figure
ggsave(filename="Figures/03_Performance/Fig3_Performance.png", plot=Performance_fig, dpi=300, width=10, height=8, units="in")
##Growth vs FvFm Retention
TLE_PAM.plot.cut<-ggplot(Perf_Set, aes(x=TLE_cm.day, y=PAM.prop)) +
geom_smooth(method="lm", color="#AA185AFF", fill="#F8D7BFFF", se=TRUE)+
geom_point(aes(colour=Site.Orig),size=point.sz)+
scale_colour_manual(values=Orig.colors.o)+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.position="none")+
labs(x=expression(paste('Growth Rate (cm day'^-1*")")),
y="Photo. Effic. Retention",
colour="Site Origin")+
annotate("text", x = 0.07, y = 0.74, label=expression(bolditalic(paste(r[S], " = -0.657, p = 0.024"))), size=sig.sz, hjust = 0)
##Growth vs Symbiont Retention
TLE_Sym.plot.cut<-ggplot(Perf_Set, aes(x=TLE_cm.day, y=Sym.prop)) +
geom_smooth(method="lm", color="#AA185AFF", fill="#F8D7BFFF", se=TRUE)+
geom_point(aes(colour=Site.Orig),size=point.sz)+
scale_colour_manual(values=Orig.colors.o)+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"), legend.position="none")+
labs(x=expression(paste('Growth Rate (cm day'^-1*")")),
y="Symbiont Retention",
colour="Site Origin")+
annotate("text", x = 0.07, y = 0, label=expression(bolditalic(paste(r[S], " = -0.643, p = 0.028"))), size=sig.sz, hjust = 0)
##Create Panel
TradeOff_fig<-plot_grid(TLE_PAM.plot.cut, TLE_Sym.plot.cut, TLE_Chl.plot,
rel_widths=c(.75, .75, 1),
rel_heights = c(1, 1, 1),
nrow=1, ncol=3, byrow=T, labels = c("A", "B", "C"))
`geom_smooth()` using formula = 'y ~ x'Warning: is.na() applied to non-(list or vector) of type 'expression'`geom_smooth()` using formula = 'y ~ x'Warning: is.na() applied to non-(list or vector) of type 'expression'`geom_smooth()` using formula = 'y ~ x'Warning: is.na() applied to non-(list or vector) of type 'expression'
##Save Figure
ggsave(filename="Figures/03_Performance/Fig4_TradeOff.png", plot=TradeOff_fig, dpi=300, width=12, height=4, units="in")
##FvFm
IN_PAM.plot.cut<-ggplot(IN_PAM.sum, aes(x=Site.Treat, y=Fv_Fm, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Fv_Fm-se, ymax=Fv_Fm+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(aes(shape=Treatment), size=point.sz, position=position_dodge(width=0.5))+
scale_shape_manual(values=c(1,16))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="Fv/Fm", colour="Site")+
ylim(0.5, 0.655)
IN_TolPAM.plot.cut<-ggplot(IN_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="Retention", colour="Site")+
ylim(0.75, 1)+
annotate("text", x=1.5, y=0.95, label="*", size=sig.sz, fontface="bold")
##Symbionts
IN_Sym.plot.cut<-ggplot(IN_Sym.sum, aes(x=Site.Treat, y=Sym10.6_cm2, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Sym10.6_cm2-se, ymax=Sym10.6_cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(aes(shape=Treatment), size=point.sz, position=position_dodge(width=0.5))+
scale_shape_manual(values=c(1,16))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y=expression(paste('Symbionts ('*10^6,'cells cm'^-2*")")), colour="Site")+
ylim(0, 1)
IN_TolSym.plot.cut<-ggplot(IN_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="Retention", colour="Site")+
ylim(.25, .75)+
annotate("text", x=1.5, y=0.7, label="-", size=sig.sz, fontface="bold")
##Chlorophyll
IN_Chl.plot.cut<-ggplot(IN_Chl.sum, aes(x=Site.Treat, y=Chl_ug.cm2, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Chl_ug.cm2-se, ymax=Chl_ug.cm2+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(aes(shape=Treatment), size=point.sz, position=position_dodge(width=0.5))+
scale_shape_manual(values=c(1,16))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="Site and Treatment", y=expression(paste('Chlorophyll (\u03BCg cm'^-2*")")), colour="Site")+
ylim(0, 1.25)
IN_TolChl.plot.cut<-ggplot(IN_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site)) +
scale_colour_manual(values=Site.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="Site", y="Retention", colour="Site")+
ylim(0, 0.25)
##Create Panel
IN_HeatAssay_fig<-plot_grid(IN_PAM.plot.cut, IN_TolPAM.plot.cut,
IN_Sym.plot.cut, IN_TolSym.plot.cut,
IN_Chl.plot.cut, IN_TolChl.plot.cut,
rel_widths=c(1, 0.75),
rel_heights = c(1, 1, 1),
nrow=3, ncol=2, byrow=T, labels = c("A", "B", "C", "D", "E", "F"))
##Save Figure
ggsave(filename="Figures/03_Performance/FigS4_InitialHeatAssay.png", plot=IN_HeatAssay_fig, dpi=300, width=8, height=11, units="in")
##FvFm
TP1_TolPAM.plot.cut<-ggplot(TP1_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
ggtitle("TP1")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="Photo. Effic. Retention", colour="Origin")+
ylim(0.7, 1)+
annotate("text", x=1, y=1, label="**", size=sig.sz, fontface="bold")
TP2_TolPAM.plot.cut<-ggplot(TP2_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
ggtitle("TP2")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="", colour="Origin")+
ylim(0.7, 1)+
annotate("text", x=1, y=1, label="*", size=sig.sz, fontface="bold")
TP3_TolPAM.plot.cut<-ggplot(TP3_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
ggtitle("TP3")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="", colour="Origin")+
ylim(0.7, 1)
TP4_TolPAM.plot.cut<-ggplot(TP4_TolPAM.sum, aes(x=Site, y=PAM.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=PAM.prop-se, ymax=PAM.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
ggtitle("TP4")+
theme(plot.title = element_text(colour="black", size=panel.lab.sz, face="bold", hjust=0.5),axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="", y="", colour="Origin")+
ylim(0.7, 1)
##Symbionts
TP1_TolSym.plot.cut<-ggplot(TP1_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="Symbiont Retention", colour="Origin")+
ylim(0.2, 1)+
annotate("text", x=1, y=0.75, label="*", size=sig.sz, fontface="bold")
TP2_TolSym.plot.cut<-ggplot(TP2_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="", colour="Origin")+
ylim(0.2, 1)
TP3_TolSym.plot.cut<-ggplot(TP3_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="", y="", colour="Origin")+
ylim(0.2, 1)
TP4_TolSym.plot.cut<-ggplot(TP4_TolSym.sum, aes(x=Site, y=Sym.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Sym.prop-se, ymax=Sym.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="", y="", colour="Origin")+
ylim(0.2, 1)
##Chlorophyll
TP1_TolChl.plot.cut<-ggplot(TP1_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="Site and Origin", y="Chlorophyll Retention", colour="Origin")+
ylim(0, .8)
TP2_TolChl.plot.cut<-ggplot(TP2_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="Site and Origin", y="", colour="Origin")+
ylim(0, .8)
TP3_TolChl.plot.cut<-ggplot(TP3_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.position="none")+
labs(x="Site and Origin", y="", colour="Origin")+
ylim(0, .8)
TP4_TolChl.plot.cut<-ggplot(TP4_TolChl.sum, aes(x=Site, y=Chl.prop, colour=Site.Orig)) +
scale_colour_manual(values=Orig.colors.o)+
geom_errorbar(aes(ymin=Chl.prop-se, ymax=Chl.prop+se), width=cap.sz, linewidth=bar.sz, position=position_dodge(width=0.5)) +
geom_point(size=point.sz, position=position_dodge(width=0.5))+
theme_classic()+
theme(axis.title.x = element_text(size = axis.title.sz), axis.title.y = element_text(size = axis.title.sz),
axis.text.x=element_text(size=axis.txt.sz, colour="black"), axis.text.y=element_text(size=axis.txt.sz, colour="black"),
legend.text=element_text(size=leg.txt.sz), legend.title=element_text(size=leg.title.sz),
legend.box.background = element_rect(color = "black"))+
labs(x="Site and Origin", y="", colour="Origin")+
ylim(0, .8)
##Create Panel
Tol_fig<-plot_grid(
TP1_TolPAM.plot.cut,TP2_TolPAM.plot.cut,TP3_TolPAM.plot.cut,TP4_TolPAM.plot.cut,
TP1_TolSym.plot.cut,TP2_TolSym.plot.cut,TP3_TolSym.plot.cut,TP4_TolSym.plot.cut,
TP1_TolChl.plot.cut,TP2_TolChl.plot.cut,TP3_TolChl.plot.cut,TP4_TolChl.plot.cut,
rel_widths=c(rep(c(0.7, 0.7, 0.7,1),3)),
rel_heights = c(1,0.85,0.85),
nrow=3, ncol=4, byrow=T, labels = NULL)
##Save Figure
ggsave(filename="Figures/03_Performance/FigS5_ToleranceMetrics.png", plot=Tol_fig, dpi=300, width=12, height=10, units="in")
##Dataframe of Performance Results
##Model Results
TableS5<-data.frame(rbind(
summary(Growth.lme_TP1.2)$coefficients[-1,],summary(Growth.lme_TP1.2_KL)$coefficients[-1,],
summary(Growth.lme_TP1.2_SS)$coefficients[-1,],
summary(Tol_PAM.lme_TP1)$coefficients[-1,],summary(Tol_PAM.lme_TP1_KL)$coefficients[-1,],
summary(Tol_PAM.lme_TP1_SS)$coefficients[-1,],
summary(Tol_Sym.lme_TP1)$coefficients[-1,],summary(Tol_Sym.lme_TP1_KL)$coefficients[-1,],
summary(Tol_Sym.lme_TP1_SS)$coefficients[-1,],
summary(Tol_Chl.lme_TP1)$coefficients[-1,],summary(Tol_Chl.lme_TP1_KL)$coefficients[-1,],
summary(Tol_Chl.lme_TP1_SS)$coefficients[-1,],
summary(Tol_PAM.lme_TP2)$coefficients[-1,],summary(Tol_PAM.lme_TP2_KL)$coefficients[-1,],
summary(Tol_PAM.lme_TP2_SS)$coefficients[-1,],
summary(Tol_Sym.lme_TP2)$coefficients[-1,],summary(Tol_Sym.lme_TP2_KL)$coefficients[-1,],
summary(Tol_Sym.lme_TP2_SS)$coefficients[-1,],
summary(Tol_Chl.lme_TP2)$coefficients[-1,],summary(Tol_Chl.lme_TP2_KL)$coefficients[-1,],
summary(Tol_Chl.lme_TP2_SS)$coefficients[-1,],
summary(Tol_PAM.lme_TP3)$coefficients[-1,],summary(Tol_PAM.lme_TP3_KL)$coefficients[-1,],
summary(Tol_PAM.lme_TP3_SS)$coefficients[-1,],
summary(Tol_Sym.lme_TP3)$coefficients[-1,],summary(Tol_Sym.lme_TP3_KL)$coefficients[-1,],
summary(Tol_Sym.lme_TP3_SS)$coefficients[-1,],
summary(Tol_Chl.lme_TP3)$coefficients[-1,],summary(Tol_Chl.lme_TP3_KL)$coefficients[-1,],
summary(Tol_Chl.lme_TP3_SS)$coefficients[-1,],
summary(Tol_PAM.lme_TP4)$coefficients[-1,],summary(Tol_PAM.lme_TP4_KL)$coefficients[-1,],
summary(Tol_PAM.lme_TP4_SS)$coefficients[-1,],
summary(Tol_Sym.lme_TP4)$coefficients[-1,],summary(Tol_Sym.lme_TP4_KL)$coefficients[-1,],
summary(Tol_Sym.lme_TP4_SS)$coefficients[-1,],
summary(Tol_Chl.lme_TP4)$coefficients[-1,],summary(Tol_Chl.lme_TP4_KL)$coefficients[-1,],
summary(Tol_Chl.lme_TP4_SS)$coefficients[-1,]))
names(TableS5)<-c("Estimate", "SE", "DF", "t", "p")
##Metadata
TableS5$Type<-c(rep("Growth", 5), rep("Tolerance", 60))
TableS5$Metric<-c(rep("Growth", 5), rep(c(rep("FvFm", 5), rep("Symbionts", 5), rep("Chlorophyll", 5)), 4))
TableS5$TimeP<-c(rep("TP1.2", 5), rep("TP1",15), rep("TP2",15), rep("TP3",15), rep("TP4",15))
TableS5$Predictor<-c(rep(c("Origin", "Site", "Origin x Site", "KL Origin", "SS Origin"), 13))
##Effect Size
TableS5$EtaSq<-c(
eta_squared(Growth.lme_TP1.2)$Eta2_partial,eta_squared(Growth.lme_TP1.2_KL)$Eta2_partial,
eta_squared(Growth.lme_TP1.2_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP1)$Eta2_partial,eta_squared(Tol_PAM.lme_TP1_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP1_SS)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP1)$Eta2_partial,eta_squared(Tol_Sym.lme_TP1_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP1_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP1)$Eta2_partial,eta_squared(Tol_Chl.lme_TP1_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP1_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP2)$Eta2_partial,eta_squared(Tol_PAM.lme_TP2_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP2_SS)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP2)$Eta2_partial,eta_squared(Tol_Sym.lme_TP2_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP2_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP2)$Eta2_partial,eta_squared(Tol_Chl.lme_TP2_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP2_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP3)$Eta2_partial,eta_squared(Tol_PAM.lme_TP3_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP3_SS)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP3)$Eta2_partial,eta_squared(Tol_Sym.lme_TP3_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP3_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP3)$Eta2_partial,eta_squared(Tol_Chl.lme_TP3_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP3_SS)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP4)$Eta2_partial,eta_squared(Tol_PAM.lme_TP4_KL)$Eta2_partial,
eta_squared(Tol_PAM.lme_TP4_SS)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP4)$Eta2_partial,eta_squared(Tol_Sym.lme_TP4_KL)$Eta2_partial,
eta_squared(Tol_Sym.lme_TP4_SS)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP4)$Eta2_partial,eta_squared(Tol_Chl.lme_TP4_KL)$Eta2_partial,
eta_squared(Tol_Chl.lme_TP4_SS)$Eta2_partial)
TableS5<-TableS5[,c(6:9, 1:5, 10)]
rownames(TableS5)<-NULL
##Save Table
write.csv(TableS5, "Outputs/TableS5.csv", row.names=FALSE)
##Dataframe of Initial Thermal Tolerance Assay Results
##Model Results
TableS6.model<-data.frame(rbind(
summary(PAM.lme_IN)$coefficients[-1,], summary(Sym.lme_IN)$coefficients[-1,], summary(Chl.lme_IN)$coefficients[-1,]))
names(TableS6.model)<-c("Estimate", "SE", "DF", "t", "p")
TableS6.emmeans<-data.frame(rbind(
data.frame(rbind(emmeans(PAM.lme_IN, pairwise ~ Site | Treatment)$contrasts[1], emmeans(PAM.lme_IN, pairwise ~ Site | Treatment)$contrasts[2], emmeans(PAM.lme_IN, pairwise ~ Treatment | Site)$contrasts[1], emmeans(PAM.lme_IN, pairwise ~ Treatment | Site)$contrasts[2]))[,-c(1:3)],
data.frame(rbind(emmeans(Sym.lme_IN, pairwise ~ Site | Treatment)$contrasts[1], emmeans(Sym.lme_IN, pairwise ~ Site | Treatment)$contrasts[2], emmeans(Sym.lme_IN, pairwise ~ Treatment | Site)$contrasts[1], emmeans(Sym.lme_IN, pairwise ~ Treatment | Site)$contrasts[2]))[,-c(1:3)],
data.frame(rbind(emmeans(Chl.lme_IN, pairwise ~ Site | Treatment)$contrasts[1], emmeans(Chl.lme_IN, pairwise ~ Site | Treatment)$contrasts[2], emmeans(Chl.lme_IN, pairwise ~ Treatment | Site)$contrasts[1], emmeans(Chl.lme_IN, pairwise ~ Treatment | Site)$contrasts[2]))[,-c(1:3)]))
names(TableS6.emmeans)<-c("Estimate", "SE", "DF", "t", "p")
TableS6<-rbind(TableS6.model[1:3,], TableS6.emmeans[1:4,], TableS6.model[4:6,], TableS6.emmeans[5:8,], TableS6.model[7:9,], TableS6.emmeans[9:12,])
##Metadata
TableS6$Metric<-c(rep("FvFm", 7), rep("Symbionts", 7), rep("Chlorophyll", 7))
TableS6$Predictor<-c(rep(c("Site", "Treatment", "Site x Treatment", "Control Site", "Heated Site", "KL Treatment", "SS Treatment"), 3))
##Effect Size
TableS6$EtaSq<-c(eta_squared(PAM.lme_IN)$Eta2_partial, NA, NA, NA, NA, eta_squared(Sym.lme_IN)$Eta2_partial, NA, NA, NA, NA, eta_squared(Chl.lme_IN)$Eta2_partial, NA, NA, NA, NA)
TableS6<-TableS6[,c(6:7, 1:5, 8)]
rownames(TableS6)<-NULL
##Save Table
write.csv(TableS6, "Outputs/TableS6.csv", row.names=FALSE)